ZipArchive.Extract Method
Namespace: Rebex.IO.Compression
Assembly: Rebex.Zip.dll (version 7.0.9119)
Extract(String, String)
Extracts specified archive item(s) into the specified local directory.
Declaration
public ArchiveOperationResult Extract(string archivePathOrMask, string targetDirectoryPath)
Parameters
Type | Name | Description |
---|---|---|
String | archivePathOrMask | Path (with or without a mask) to an archive item(s). |
String | targetDirectoryPath | Path to an existing local directory to which to extract files. |
Returns
Type | Description |
---|---|
ArchiveOperationResult | Operation result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The specified path is null. |
ArgumentException | The specified path is empty or contains invalid characters. -or- Illegal use of wildcards in path. -or- The system could not retrieve the absolute path. |
ObjectDisposedException | Archive was already disposed. |
NotSupportedException | Path is in an invalid format. |
PathTooLongException |
|
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. |
IOException | An I/O error occurred. |
ZipException | Cannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information). |
Extract(FileSet, String)
Extracts specified archive item(s) into the specified local directory.
Declaration
public ArchiveOperationResult Extract(FileSet set, string targetDirectoryPath)
Parameters
Type | Name | Description |
---|---|---|
FileSet | set | A filtering set which specifies external (local) files and directories to be extracted. |
String | targetDirectoryPath | Path to an existing local directory to which to extract files. |
Returns
Type | Description |
---|---|
ArchiveOperationResult | Operation result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | The specified path is empty or contains invalid characters. -or- The system could not retrieve the absolute path. |
ObjectDisposedException | Archive was already disposed. |
NotSupportedException | Path is in an invalid format. |
PathTooLongException |
|
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. |
IOException | An I/O error occurred. |
ZipException | Cannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information). |
Extract(String, String, TraversalMode)
Extracts specified archive item(s) into the specified local directory.
Declaration
public ArchiveOperationResult Extract(string archivePathOrMask, string targetDirectoryPath, TraversalMode mode)
Parameters
Type | Name | Description |
---|---|---|
String | archivePathOrMask | Path (with or without a mask) to an archive item(s). |
String | targetDirectoryPath | Path to an existing local directory to which to extract files. |
TraversalMode | mode | Traversal mode. |
Returns
Type | Description |
---|---|
ArchiveOperationResult | Operation result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The specified path is null. |
ArgumentException | The specified path is empty or contains invalid characters. -or- Illegal use of wildcards in path. -or- Ambiguous usage of path and mode. -or- The system could not retrieve the absolute path. |
ArgumentOutOfRangeException | The |
ObjectDisposedException | Archive was already disposed. |
NotSupportedException | Path is in an invalid format. |
PathTooLongException |
|
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. |
IOException | An I/O error occurred. |
ZipException | Cannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information). |
Extract(String, String, TraversalMode, TransferMethod, ActionOnExistingFiles)
Extracts specified archive item(s) into the specified local directory.
Declaration
public ArchiveOperationResult Extract(string archivePathOrMask, string targetDirectoryPath, TraversalMode mode, TransferMethod transferMethod, ActionOnExistingFiles defaultActionOnExistingFiles)
Parameters
Type | Name | Description |
---|---|---|
String | archivePathOrMask | Path (with or without a mask) to an archive item(s). |
String | targetDirectoryPath | Path to an existing local directory to which to extract files. |
TraversalMode | mode | Traversal mode. |
TransferMethod | transferMethod | Specifies whether to copy or move source items. |
ActionOnExistingFiles | defaultActionOnExistingFiles | Specifies the default behavior for files that already exists in the local directory. |
Returns
Type | Description |
---|---|
ArchiveOperationResult | Operation result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The specified path is null. |
ArgumentException | The specified path is empty or contains invalid characters. -or- Illegal use of wildcards in path. -or- Ambiguous usage of path and mode. -or- The system could not retrieve the absolute path. |
ArgumentOutOfRangeException | The |
ObjectDisposedException | Archive was already disposed. |
NotSupportedException | Path is in an invalid format. |
PathTooLongException |
|
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. |
IOException | An I/O error occurred. |
ZipException | Cannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information). |
Extract(FileSet, String, TransferMethod, ActionOnExistingFiles)
Extracts specified archive item(s) into the specified local directory.
Declaration
public ArchiveOperationResult Extract(FileSet set, string targetDirectoryPath, TransferMethod transferMethod, ActionOnExistingFiles defaultActionOnExistingFiles)
Parameters
Type | Name | Description |
---|---|---|
FileSet | set | A filtering set which specifies external (local) files and directories to be extracted. |
String | targetDirectoryPath | Path to an existing local directory to which to extract files. |
TransferMethod | transferMethod | Specifies whether to copy or move source items. |
ActionOnExistingFiles | defaultActionOnExistingFiles | Specifies the default behavior for files that already exists in the local directory. |
Returns
Type | Description |
---|---|
ArchiveOperationResult | Operation result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | The specified path is empty or contains invalid characters. -or- The system could not retrieve the absolute path. |
ArgumentOutOfRangeException | The |
ObjectDisposedException | Archive was already disposed. |
NotSupportedException | Path is in an invalid format. |
PathTooLongException |
|
SecurityException | The caller does not have the required permissions. |
UnauthorizedAccessException | Access to the file is denied. |
IOException | An I/O error occurred. |
ZipException | Cannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information). |
Extract(String, String, String)
Extracts specified archive item(s) from the specified ZIP archive into the specified local directory.
Declaration
public static ArchiveOperationResult Extract(string zipFilePath, string archivePathOrMask, string targetDirectoryPath)
Parameters
Type | Name | Description |
---|---|---|
String | zipFilePath | Path to a ZIP archive file. |
String | archivePathOrMask | Path (with or without a mask) to an archive item(s). |
String | targetDirectoryPath | Path to an existing local directory to which to extract files. |
Returns
Type | Description |
---|---|
ArchiveOperationResult | Operation result. |
Extract(String, String, String, TraversalMode, TransferMethod, ActionOnExistingFiles)
Extracts specified archive item(s) from the specified ZIP archive into the specified local directory.
Declaration
public static ArchiveOperationResult Extract(string zipFilePath, string archivePathOrMask, string targetDirectoryPath, TraversalMode mode, TransferMethod transferMethod, ActionOnExistingFiles defaultActionOnExistingFiles)
Parameters
Type | Name | Description |
---|---|---|
String | zipFilePath | Path to a ZIP archive file. |
String | archivePathOrMask | Path (with or without a mask) to an archive item(s). |
String | targetDirectoryPath | Path to an existing local directory to which to extract files. |
TraversalMode | mode | Traversal mode. |
TransferMethod | transferMethod | Specifies whether to copy or move source items. |
ActionOnExistingFiles | defaultActionOnExistingFiles | Specifies the default behavior for files that already exists in the local directory. |
Returns
Type | Description |
---|---|
ArchiveOperationResult | Operation result. |