ZipArchive.ExtractFileAsync Method
Namespace: Rebex.IO.Compression
Assembly: Rebex.Zip.dll (version 7.0.9147)
ExtractFileAsync(String, String, Object)
Begins asynchronous ExtractFile operation. Extracts the specified archive file item into a local file.
Declaration
public Task<ArchiveOperationResult> ExtractFileAsync(string archiveFilePath, string targetPath, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | archiveFilePath | Path to an archive file to be extracted. |
String | targetPath | Path to a (non-existing) local file or path to a directory ending with directory separator (typically ''). |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Archive |
Operation result. |
Exceptions
Type | Condition |
---|---|
Argument |
The specified path is null. |
Argument |
The specified path is empty or contains invalid characters. -or- The system could not retrieve the absolute path. |
Invalid |
The specified path is not a file. |
Object |
Archive was already disposed. |
Not |
Path is in an invalid format. |
Path |
|
Directory |
Part of the target path was not found. |
Security |
The caller does not have the required permissions. |
Unauthorized |
Access to the file is denied. |
IOException | Local file already exists or an I/O error occurred. |
Zip |
Cannot perform the requested operation, or the operation was canceled
(see Problem |
ExtractFileAsync(String, String, ActionOnExistingFiles, Object)
Begins asynchronous ExtractFile operation. Extracts the specified archive file item into a local file.
Declaration
public Task<ArchiveOperationResult> ExtractFileAsync(string archiveFilePath, string targetPath, ActionOnExistingFiles defaultActionOnExistingFiles, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | archiveFilePath | Path to an archive file to be extracted. |
String | targetPath | Path to a (non-existing) local file or path to a directory ending with directory separator (typically ''). |
Action |
defaultActionOnExistingFiles | Specifies the default behavior for files that already exists in the local directory. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Archive |
Operation result. |
Exceptions
Type | Condition |
---|---|
Argument |
The specified path is null. |
Argument |
The specified path is empty or contains invalid characters. -or- The system could not retrieve the absolute path. |
Invalid |
The specified path is not a file. |
Object |
Archive was already disposed. |
Not |
Path is in an invalid format. |
Path |
|
Directory |
Part of the target path was not found. |
Security |
The caller does not have the required permissions. |
Unauthorized |
Access to the file is denied. |
IOException | An I/O error occurred. |
Zip |
Cannot perform the requested operation, or the operation was canceled
(see Problem |
ExtractFileAsync(String, Stream, Object)
Begins asynchronous ExtractFile operation. Extracts the specified archive file item into a stream.
Declaration
public Task<ArchiveOperationResult> ExtractFileAsync(string archiveFilePath, Stream outputStream, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | archiveFilePath | Path to an archive file to be extracted. |
Stream | outputStream | Stream to write the extracted data to. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Archive |
Operation result. |
Remarks
Note that data will be written to the current output stream position.
Exceptions
Type | Condition |
---|---|
Argument |
The specified path or output stream is null. |
Argument |
The specified path is empty. |
Invalid |
The output stream is not writable. -or- The specified path is not a file. |
Object |
Archive was already disposed. |
IOException | An I/O error occurred. |
Zip |
Cannot perform the requested operation, or the operation was canceled
(see Problem |