Begins asynchronous AddFile operation.
Adds the specified local file to the specified directory within the ZIP archive.
Namespace:
Rebex.IO.Compression
Assembly:
Rebex.Zip (in Rebex.Zip.dll)
Syntax
Visual Basic |
---|
Public Sub AddFileAsync ( _ sourceFilePath As String, _ archivePath As String, _ defaultActionOnExistingFiles As ActionOnExistingFiles _ ) |
C# |
---|
public void AddFileAsync( string sourceFilePath, string archivePath, ActionOnExistingFiles defaultActionOnExistingFiles ) |
Parameters
- sourceFilePath
- Type: System..::..String
Path to a local file to be added.
- archivePath
- Type: System..::..String
Path to a (non-existing) file archive item or path to a directory item ending with directory separator (typically '\'). Null reference (Nothing in Visual Basic) means root.
- defaultActionOnExistingFiles
- Type: Rebex.IO..::..ActionOnExistingFiles
Specifies the default behavior for files that already exists in the local directory.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | sourceFilePath is null. |
System..::..ArgumentException | The specified path is empty or contains invalid characters. -or- The system could not retrieve the absolute path. |
System..::..InvalidOperationException | Archive is not opened for writing. -or- sourceFilePath refers to the ZIP archive itself. |
System..::..ObjectDisposedException | Archive was already disposed. |
System..::..NotSupportedException | Path is in an invalid format. |
System.IO..::..PathTooLongException | sourceFilePath exceed the maximum length defined by system. -or- archivePath is longer than 65.535 characters. |
System.IO..::..DirectoryNotFoundException | Part of the source path was not found. |
System.IO..::..FileNotFoundException | The source file was not found. |
System.Security..::..SecurityException | The caller does not have the required permissions. |
System..::..UnauthorizedAccessException | Access to the file is denied. |
System.IO..::..IOException | An I/O error occurred. |
Rebex.IO.Compression..::..ZipException | Cannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information). |