ExtractAll Method (path, extractExistingFile)

DotNetZip

Ionic Zip Library v1.9.1.6 ExtractAll Method (path, extractExistingFile)
ReferenceIonic.ZipZipFileExtractAll(String, ExtractExistingFileAction)
Extracts all of the items in the zip archive, to the specified path in the filesystem, using the specified behavior when extraction would overwrite an existing file.
Declaration Syntax
C# Visual Basic Visual C++
public void ExtractAll(
	string path,
	ExtractExistingFileAction extractExistingFile
)
Public Sub ExtractAll ( _
	path As String, _
	extractExistingFile As ExtractExistingFileAction _
)
public:
void ExtractAll(
	String^ path, 
	ExtractExistingFileAction extractExistingFile
)
Parameters
path (String)
The path to which the contents of the zipfile will be extracted. The path can be relative or fully-qualified.
extractExistingFile (ExtractExistingFileAction)
The action to take if extraction would overwrite an existing file.
Remarks

This method will extract all entries in the ZipFile to the specified path. For an extraction that would overwrite an existing file, the behavior is dictated by extractExistingFile, which overrides any setting you may have made on individual ZipEntry instances.

The action to take when an extract would overwrite an existing file applies to all entries. If you want to set this on a per-entry basis, then you must use Extract(String, ExtractExistingFileAction) or one of the similar methods.

Calling this method is equivalent to setting the ExtractExistingFile property and then calling ExtractAll(String).

This method will send verbose output messages to the StatusMessageTextWriter, if it is set on the ZipFile instance.

Examples
This example extracts all the entries in a zip archive file, to the specified target directory. It does not overwrite any existing files.
CopyC#
String TargetDirectory= "c:\\unpack";
using(ZipFile zip= ZipFile.Read(ZipFileToExtract))
{
  zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite);
}
CopyVB.NET
Dim TargetDirectory As String = "c:\unpack"
Using zip As ZipFile = ZipFile.Read(ZipFileToExtract)
    zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite)
End Using

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