UpdateItem Method (itemName, directoryPathInArchive)

DotNetZip

Ionic Zip Library v1.9.1.6 UpdateItem Method (itemName, directoryPathInArchive)
ReferenceIonic.ZipZipFileUpdateItem(String, String)
Add or update a file or directory.
Declaration Syntax
C# Visual Basic Visual C++
public void UpdateItem(
	string itemName,
	string directoryPathInArchive
)
Public Sub UpdateItem ( _
	itemName As String, _
	directoryPathInArchive As String _
)
public:
void UpdateItem(
	String^ itemName, 
	String^ directoryPathInArchive
)
Parameters
itemName (String)
The path for the File or Directory to be added or updated.
directoryPathInArchive (String)
Specifies a directory path to use to override any path in the itemName. This path may, or may not, correspond to a real directory in the current filesystem. If the files within the zip are later extracted, this is the path used for the extracted file. Passing null (Nothing in VB) will use the path on the itemName, if any. Passing the empty string ("") will insert the item at the root path within the archive.
Remarks

This method is useful when the application is not sure or does not care if the item to be added is a file or directory, and does not know or does not care if the item already exists in the ZipFile. Calling this method is equivalent to calling RemoveEntry(), if an entry by that name exists, and then calling AddItem().

This version of the method allows the caller to explicitly specify the directory path to be used for the item being added to the archive. The entry or entries that are added or updated will use the specified DirectoryPathInArchive. Extracting the entry from the archive will result in a file stored in that directory path.

For ZipFile properties including Encryption, Password, SetCompression, ProvisionalAlternateEncoding, ExtractExistingFile, ZipErrorAction, and CompressionLevel, their respective values at the time of this call will be applied to the ZipEntry added.

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)