ZipArchive Constructor
Namespace: Rebex.IO.Compression
Assembly: Rebex.Zip.dll (version 7.0.9119)
ZipArchive(String)
Initializes a ZipArchive object with the specified ZIP archive.
Declaration
public ZipArchive(string zipFilePath)
Parameters
Type | Name | Description |
---|---|---|
String | zipFilePath | Path to a ZIP archive file. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
NotSupportedException | Path is in an invalid format. |
PathTooLongException | The specified path exceed the maximum length defined by system. |
DirectoryNotFoundException | Part of the specified path was not found. |
FileNotFoundException | The specified file path was not found. |
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. -or- The specified path refers to a directory. |
IOException | An I/O error occurred. |
ZipException | Archive cannot be opened (see ProblemType for detailed information). |
ZipArchive(String, ArchiveOpenMode)
Initializes a ZipArchive object with the specified ZIP archive.
Declaration
public ZipArchive(string zipFilePath, ArchiveOpenMode openMode)
Parameters
Type | Name | Description |
---|---|---|
String | zipFilePath | Path to a ZIP archive file. |
ArchiveOpenMode | openMode | Open mode - specified whether to open an existing ZIP archive, create new ZIP archive, etc. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentOutOfRangeException |
|
NotSupportedException | Path is in an invalid format. |
PathTooLongException | The specified path exceed the maximum length defined by system. |
DirectoryNotFoundException | Part of the specified path was not found. |
FileNotFoundException | The specified file path was not found. |
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. -or- The specified path refers to a directory. |
IOException | An I/O error occurred. |
ZipException | Archive cannot be opened (see ProblemType for detailed information). |
ZipArchive(String, ArchiveOpenMode, ArchiveAccessMode)
Initializes a ZipArchive object with the specified ZIP file.
Declaration
public ZipArchive(string zipFilePath, ArchiveOpenMode openMode, ArchiveAccessMode accessMode)
Parameters
Type | Name | Description |
---|---|---|
String | zipFilePath | Path to a ZIP archive file. |
ArchiveOpenMode | openMode | Open mode - specified whether to open an existing ZIP archive, create new ZIP archive, etc. |
ArchiveAccessMode | accessMode | Access mode - specifies whether to open a ZIP file in read-write, read-only or auto mode. |
Remarks
If no changes are to be made to the ZIP archive, use Read.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentOutOfRangeException | The |
NotSupportedException | Path is in an invalid format. |
PathTooLongException | The specified path exceed the maximum length defined by system. |
DirectoryNotFoundException | Part of the specified path was not found. |
FileNotFoundException | The specified file path was not found. |
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. -or- The specified path refers to a directory. -or- Path specified a file that is read-only and access is not Read. |
IOException | An I/O error occurred. |
ZipException | Archive cannot be opened (see ProblemType for detailed information). |
ZipArchive(Stream)
Initializes a ZipArchive object with the specified ZIP archive stream.
Declaration
public ZipArchive(Stream zipStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | zipStream | A readable/seekable stream containing a ZIP archive or empty writable/seekable stream where to create a new ZIP archive. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | Specified stream is not seekable or readable. |
IOException | An I/O error occurred. |
ZipException | Archive cannot be opened (see ProblemType for detailed information). |
ZipArchive(Stream, ArchiveStreamCloseMode)
Initializes a ZipArchive object with the specified ZIP archive stream.
Declaration
public ZipArchive(Stream zipStream, ArchiveStreamCloseMode closeMode)
Parameters
Type | Name | Description |
---|---|---|
Stream | zipStream | A readable/seekable stream containing a ZIP archive or empty writable/seekable stream where to create a new ZIP archive. |
ArchiveStreamCloseMode | closeMode | A close behavior of the |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | Specified stream is not seekable or readable. |
IOException | An I/O error occurred. |
ZipException | Archive cannot be opened (see ProblemType for detailed information). |
ZipArchive(Stream, ZipArchiveOpenOptions)
Initializes a ZipArchive object with the specified ZIP archive stream.
Declaration
public ZipArchive(Stream zipStream, ZipArchiveOpenOptions options)
Parameters
Type | Name | Description |
---|---|---|
Stream | zipStream | A readable/seekable stream containing a ZIP archive or empty writable/seekable stream where to create a new ZIP archive. |
ZipArchiveOpenOptions | options | An options used to initialize this object. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | Specified stream is not seekable or readable. |
IOException | An I/O error occurred. |
ZipException | Archive cannot be opened (see ProblemType for detailed information). |