ExtractSelectedEntries Method (selectionCriteria, directoryPathInArchive, extractDirectory, extractExistingFile)

DotNetZip

Ionic Zip Library v1.9.1.6 ExtractSelectedEntries Method (selectionCriteria, directoryPathInArchive, extractDirectory, extractExistingFile)
ReferenceIonic.ZipZipFileExtractSelectedEntries(String, String, String, ExtractExistingFileAction)
Selects and Extracts a set of Entries from the ZipFile.
Declaration Syntax
C# Visual Basic Visual C++
public void ExtractSelectedEntries(
	string selectionCriteria,
	string directoryPathInArchive,
	string extractDirectory,
	ExtractExistingFileAction extractExistingFile
)
Public Sub ExtractSelectedEntries ( _
	selectionCriteria As String, _
	directoryPathInArchive As String, _
	extractDirectory As String, _
	extractExistingFile As ExtractExistingFileAction _
)
public:
void ExtractSelectedEntries(
	String^ selectionCriteria, 
	String^ directoryPathInArchive, 
	String^ extractDirectory, 
	ExtractExistingFileAction extractExistingFile
)
Parameters
selectionCriteria (String)
the selection criteria for entries to extract.
directoryPathInArchive (String)
The directory in the archive from which to select entries. If null, then all directories in the archive are used.
extractDirectory (String)
The directory on the disk into which to extract. It will be created if it does not exist.
extractExistingFile (ExtractExistingFileAction)
The action to take if extraction would overwrite an existing file.
Remarks

The entries are extracted into the specified directory. When extraction would would overwrite an existing filesystem file, the action taken is as specified in the extractExistingFile parameter.

For information on the syntax of the string describing the entry selection criteria, see AddSelectedFiles(String).

Examples
This example shows how extract all files with an XML extension or with a size larger than 100,000 bytes, and puts them in the unpack directory. For any files that already exist in that destination directory, they will not be overwritten.
CopyC#
using (ZipFile zip = ZipFile.Read(zipArchiveName))
{
  zip.ExtractSelectedEntries("name = *.xml  or  size > 100000",
                             null,
                             "unpack",
                             ExtractExistingFileAction.DontOverwrite);
}

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