Skip to content

Commit 9c1f973

Browse files
committed
add password to Extract all method
1 parent bb86813 commit 9c1f973

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

Pack.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
dotnet build -c Release
22
dotnet test -c Release
33
dotnet pack -c Release -o artifacts SevenZipExtractor\SevenZipExtractor.csproj
4-
dotnet nuget push artifacts\SevenZipExtractor.1.0.17.nupkg --source https://www.nuget.org/api/v2/package
5-
# h:\nuget pack H:\SevenZipExtractorGit\SevenZipExtractor\SevenZipExtractor\SevenZipExtractor.csproj -IncludeReferencedProjects -Prop Configuration=Release
4+
dotnet nuget push artifacts\SevenZipExtractor.1.0.19.nupkg --source https://www.nuget.org/api/v2/package# h:\nuget pack H:\SevenZipExtractorGit\SevenZipExtractor\SevenZipExtractor\SevenZipExtractor.csproj -IncludeReferencedProjects -Prop Configuration=Release
65
#h:\nuget push SevenZipExtractor.1.0.15.nupkg -Source https://www.nuget.org/api/v2/package

SevenZipExtractor/ArchiveFile.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public class ArchiveFile : IDisposable
1515

1616
private string libraryFilePath;
1717

18+
public SevenZipFormat Format { get; private set; }
19+
1820
public ArchiveFile(string archiveFilePath, string libraryFilePath = null)
1921
{
2022
this.libraryFilePath = libraryFilePath;
@@ -27,6 +29,7 @@ public ArchiveFile(string archiveFilePath, string libraryFilePath = null)
2729
}
2830

2931
SevenZipFormat format;
32+
3033
string extension = Path.GetExtension(archiveFilePath);
3134

3235
if (this.GuessFormatFromExtension(extension, out format))
@@ -41,7 +44,8 @@ public ArchiveFile(string archiveFilePath, string libraryFilePath = null)
4144
{
4245
throw new SevenZipException(Path.GetFileName(archiveFilePath) + " is not a known archive type");
4346
}
44-
Format = format;
47+
48+
this.Format = format;
4549

4650
this.archive = this.sevenZipHandle.CreateInArchive(Formats.FormatGuidMapping[format]);
4751
this.archiveStream = new InStreamWrapper(File.OpenRead(archiveFilePath));
@@ -71,15 +75,15 @@ public ArchiveFile(Stream archiveStream, SevenZipFormat? format = null, string l
7175
throw new SevenZipException("Unable to guess format automatically");
7276
}
7377
}
74-
Format = format.Value;
78+
79+
this.Format = format.Value;
7580

7681
this.archive = this.sevenZipHandle.CreateInArchive(Formats.FormatGuidMapping[format.Value]);
7782
this.archiveStream = new InStreamWrapper(archiveStream);
7883
}
7984

80-
public SevenZipFormat Format { get; private set; }
8185

82-
public void Extract(string outputFolder, bool overwrite = false)
86+
public void Extract(string outputFolder, bool overwrite = false, string password = null)
8387
{
8488
this.Extract(entry =>
8589
{
@@ -96,7 +100,8 @@ public void Extract(string outputFolder, bool overwrite = false)
96100
}
97101

98102
return null;
99-
});
103+
},
104+
password);
100105
}
101106

102107
public void Extract(Func<Entry, string> getOutputPath, string password = null)

SevenZipExtractor/SevenZipExtractor.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<AssemblyTitle>SevenZipWrapper</AssemblyTitle>
55
<Product>SevenZipWrapper</Product>
66
<Description>C# wrapper for 7z.dll (included)</Description>
7-
<Copyright>Copyright 2022</Copyright>
8-
<Version>1.0.16</Version>
7+
<Copyright>Copyright 2025</Copyright>
8+
<Version>1.0.19</Version>
99
<OutputPath>bin\$(Configuration)\</OutputPath>
1010
<Authors>Eugene Sichkar, Alexander Selishchev, @matortheeternal, Hajin Jang, Artem Tarasov, Jose Pineiro, Raphael Stoeckli, Wojciech Nagórski</Authors>
1111
<PackageId>SevenZipExtractor</PackageId>
1212
<PackageProjectUrl>https://github.com/adoconnection/SevenZipExtractor</PackageProjectUrl>
1313
<PackageTags>7Zip APM Arj BZip2 Cab Chm Compound Cpio CramFS Deb Dll Dmg Exe Fat Flv GZip Hfs Iso Lzh Lzma Lzma86 Mach-O Mbr Mub Nsis Ntfs Ppmd Rar Rar5 Rpm Split SquashFS Swf Swfc Tar TE Udf UEFIc UEFIs Vhd Wim Xar XZ Z Zip</PackageTags>
14-
<PackageVersion>1.0.17</PackageVersion>
14+
<PackageVersion>1.0.19</PackageVersion>
1515
</PropertyGroup>
1616

1717
<ItemGroup>

0 commit comments

Comments
 (0)