Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

ZipArchive Constructor

Namespace: Rebex.IO.Compression
Assembly: Rebex.Zip.dll (version 7.0.9147)

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

zipFilePath is null.

ArgumentException

zipFilePath is empty or contains invalid characters. -or- The system could not retrieve the absolute path.

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

zipFilePath is null.

ArgumentException

zipFilePath is empty or contains invalid characters. -or- The system could not retrieve the absolute path.

ArgumentOutOfRangeException

openMode specified an invalid value.

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

zipFilePath is null.

ArgumentException

zipFilePath is empty or contains invalid characters. -or- The system could not retrieve the absolute path. -or- Invalid combination of the openMode and accessMode.

ArgumentOutOfRangeException

The openMode or accessMode specified an invalid value.

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

zipStream is null.

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 zipStream.

Exceptions
Type Condition
ArgumentNullException

zipStream is null.

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

zipStream is null.

ArgumentException

Specified stream is not seekable or readable.

IOException

An I/O error occurred.

ZipException

Archive cannot be opened (see ProblemType for detailed information).

In This Article
  • ZipArchive(String)
  • ZipArchive(String, ArchiveOpenMode)
  • ZipArchive(String, ArchiveOpenMode, ArchiveAccessMode)
  • ZipArchive(Stream)
  • ZipArchive(Stream, ArchiveStreamCloseMode)
  • ZipArchive(Stream, ZipArchiveOpenOptions)
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies