C# Class ICSharpCode.SharpZipLib.Zip.ZipEntry

This class represents an entry in a zip archive. This can be a file or a directory ZipFile and ZipInputStream will give you instances of this class as information about the members in an archive. ZipOutputStream uses an instance of this class when creating an entry in a Zip file.

Author of the original java version : Jochen Hoenicke
显示文件 Open project: icsharpcode/SharpZipLib Class Usage Examples

Private Properties

Property Type Description
GetDateTime DateTime
HasDosAttributes bool
ProcessAESExtraData void
ProcessExtraData void
ZipEntry System
ZipEntry System
ZipEntry System

Public Methods

Method Description
CleanName ( string name ) : string

Cleans a name making it conform to Zip file conventions. Devices names ('c:\') and UNC share names ('\\server\share') are removed and forward slashes ('\') are converted to back slashes ('/'). Names are made relative by trimming leading slashes which is compatible with the ZIP naming convention.

The Zip name transform class is more flexible.

Clone ( ) : object

Creates a copy of this zip entry.

ForceZip64 ( ) : void

Force this entry to be recorded using Zip64 extensions.

IsCompressionMethodSupported ( ) : bool

Test entry to see if data can be extracted.

IsCompressionMethodSupported ( CompressionMethod method ) : bool

Test a compression method to see if this library supports extracting data compressed with that method

IsZip64Forced ( ) : bool

Get a value indicating wether Zip64 extensions were forced.

ToString ( ) : string

Gets a string representation of this ZipEntry.

ZipEntry ( string name ) : System

Creates a zip entry with the given name.

Private Methods

Method Description
GetDateTime ( ZipExtraData extraData ) : DateTime
HasDosAttributes ( int attributes ) : bool

Test the external attributes for this ZipEntry to see if the external attributes are Dos based (including WINNT and variants) and match the values

ProcessAESExtraData ( ZipExtraData extraData ) : void
ProcessExtraData ( bool localHeader ) : void

Process extra data fields updating the entry based on the contents.

ZipEntry ( ZipEntry entry ) : System
ZipEntry ( string name, int versionRequiredToExtract ) : System

Creates a zip entry with the given name and version required to extract

ZipEntry ( string name, int versionRequiredToExtract, int madeByInfo, CompressionMethod method ) : System

Initializes an entry with the given name and made by information

This constructor is used by the ZipFile class when reading from the central header It is not generally useful, use the constructor specifying the name only.

Method Details

CleanName() public static method

Cleans a name making it conform to Zip file conventions. Devices names ('c:\') and UNC share names ('\\server\share') are removed and forward slashes ('\') are converted to back slashes ('/'). Names are made relative by trimming leading slashes which is compatible with the ZIP naming convention.
The Zip name transform class is more flexible.
public static CleanName ( string name ) : string
name string The name to clean
return string

Clone() public method

Creates a copy of this zip entry.
public Clone ( ) : object
return object

ForceZip64() public method

Force this entry to be recorded using Zip64 extensions.
public ForceZip64 ( ) : void
return void

IsCompressionMethodSupported() public method

Test entry to see if data can be extracted.
public IsCompressionMethodSupported ( ) : bool
return bool

IsCompressionMethodSupported() public static method

Test a compression method to see if this library supports extracting data compressed with that method
public static IsCompressionMethodSupported ( CompressionMethod method ) : bool
method CompressionMethod The compression method to test.
return bool

IsZip64Forced() public method

Get a value indicating wether Zip64 extensions were forced.
public IsZip64Forced ( ) : bool
return bool

ToString() public method

Gets a string representation of this ZipEntry.
public ToString ( ) : string
return string

ZipEntry() public method

Creates a zip entry with the given name.
/// The name passed is null ///
public ZipEntry ( string name ) : System
name string /// The name for this entry. Can include directory components. /// The convention for names is 'unix' style paths with relative names only. /// There are with no device names and path elements are separated by '/' characters. ///
return System