|
Fingerprint_Card
|
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.
More...


Public Member Functions | |
| ZipEntry (string name) | |
| Creates a zip entry with the given name. | |
| ZipEntry (ZipEntry entry) | |
| Creates a deep copy of the given zip entry. | |
| void | ForceZip64 () |
| Force this entry to be recorded using Zip64 extensions. | |
| bool | IsZip64Forced () |
| Get a value indicating wether Zip64 extensions were forced. | |
| bool | IsCompressionMethodSupported () |
| Test entry to see if data can be extracted. | |
| object | Clone () |
| Creates a copy of this zip entry. | |
| override string | ToString () |
| Gets a string representation of this ZipEntry. | |
Static Public Member Functions | |
| static bool | IsCompressionMethodSupported (CompressionMethod method) |
| Test a compression method to see if this library supports extracting data compressed with that method. | |
| static string | CleanName (string name) |
| 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. | |
Package Functions | |
| ZipEntry (string name, int versionRequiredToExtract) | |
| Creates a zip entry with the given name and version required to extract. | |
| ZipEntry (string name, int versionRequiredToExtract, int madeByInfo, CompressionMethod method) | |
| Initializes an entry with the given name and made by information. | |
| void | ProcessExtraData (bool localHeader) |
| Process extra data fields updating the entry based on the contents. | |
Properties | |
| bool | HasCrc [get] |
| Get a value indicating wether the entry has a CRC value available. | |
| bool | IsCrypted [get, set] |
| Get/Set flag indicating if entry is encrypted. A simple helper routine to aid interpretation of flags | |
| bool | IsUnicodeText [get, set] |
| Get / set a flag indicating wether entry name and comment text are encoded in unicode UTF8. | |
| byte | CryptoCheckValue [get, set] |
| Value used during password checking for PKZIP 2.0 / 'classic' encryption. | |
| int | Flags [get, set] |
| Get/Set general purpose bit flag for entry. | |
| long | ZipFileIndex [get, set] |
| Get/Set index of this entry in Zip file. | |
| long | Offset [get, set] |
| Get/set offset for use in central header. | |
| int | ExternalFileAttributes [get, set] |
| Get/Set external file attributes as an integer. The values of this are operating system dependant see HostSystem for details. | |
| int | VersionMadeBy [get] |
| Get the version made by for this entry or zero if unknown. The value / 10 indicates the major version number, and the value mod 10 is the minor version number. | |
| bool | IsDOSEntry [get] |
| Get a value indicating this entry is for a DOS/Windows system. | |
| int | HostSystem [get, set] |
| Gets the compatability information for the external file attribute If the external file attributes are compatible with MS-DOS and can be read by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value will be non-zero and identify the host system on which the attributes are compatible. | |
| int | Version [get] |
| Get minimum Zip feature version required to extract this entry. | |
| bool | CanDecompress [get] |
| Get a value indicating whether this entry can be decompressed by the library. | |
| bool | LocalHeaderRequiresZip64 [get] |
| Gets a value indicating if the entry requires Zip64 extensions to store the full entry values. | |
| bool | CentralHeaderRequiresZip64 [get] |
| Get a value indicating wether the central directory entry requires Zip64 extensions to be stored. | |
| long | DosTime [get, set] |
| Get/Set DosTime value. | |
| DateTime | DateTime [get, set] |
| Gets/Sets the time of last modification of the entry. | |
| string | Name [get] |
| Returns the entry name. | |
| long | Size [get, set] |
| Gets/Sets the size of the uncompressed data. | |
| long | CompressedSize [get, set] |
| Gets/Sets the size of the compressed data. | |
| long | Crc [get, set] |
| Gets/Sets the crc of the uncompressed data. | |
| CompressionMethod | CompressionMethod [get, set] |
| Gets/Sets the compression method. Only Deflated and Stored are supported. | |
| CompressionMethod | CompressionMethodForHeader [get] |
| Gets the compression method for outputting to the local or central header. Returns same value as CompressionMethod except when AES encrypting, which places 99 in the method and places the real method in the extra data. | |
| byte[] | ExtraData [get, set] |
| Gets/Sets the extra data. | |
| int | AESKeySize [get, set] |
| For AES encrypted files returns or sets the number of bits of encryption (128, 192 or 256). When setting, only 0 (off), 128 or 256 is supported. | |
| byte | AESEncryptionStrength [get] |
| AES Encryption strength for storage in extra data in entry header. 1 is 128 bit, 2 is 192 bit, 3 is 256 bit. | |
| int | AESSaltLen [get] |
| Returns the length of the salt, in bytes. | |
| int | AESOverheadSize [get] |
| Number of extra bytes required to hold the AES Header fields (Salt, Pwd verify, AuthCode) | |
| string | Comment [get, set] |
| Gets/Sets the entry comment. | |
| bool | IsDirectory [get] |
| Gets a value indicating if the entry is a directory. however. | |
| bool | IsFile [get] |
| Get a value of true if the entry appears to be a file; false otherwise. | |
Private Types | |
| enum | Known : byte { None = 0 , Size = 0x01 , CompressedSize = 0x02 , Crc = 0x04 , Time = 0x08 , ExternalAttributes = 0x10 } |
Private Member Functions | |
| bool | HasDosAttributes (int attributes) |
| Test the external attributes for this ZipEntry to see if the external attributes are Dos based (including WINNT and variants) and match the values. | |
| void | ProcessAESExtraData (ZipExtraData extraData) |
Private Attributes | |
| Known | known |
| int | externalFileAttributes = -1 |
| ushort | versionMadeBy |
| string | name |
| ulong | size |
| ulong | compressedSize |
| ushort | versionToExtract |
| uint | crc |
| uint | dosTime |
| CompressionMethod | method = CompressionMethod.Deflated |
| byte[] | extra |
| string | comment |
| int | flags |
| long | zipFileIndex = -1 |
| long | offset |
| bool | forceZip64_ |
| byte | cryptoCheckValue_ |
| int | _aesVer |
| int | _aesEncryptionStrength |
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.
|
private |
| ICSharpCode.SharpZipLib.Zip.ZipEntry.ZipEntry | ( | string | name | ) |
Creates a zip entry with the given name.
| name | 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. |
| ArgumentNullException | The name passed is null |

|
package |
Creates a zip entry with the given name and version required to extract.
| name | The name for this entry. Can include directory components. The convention for names is 'unix' style paths with no device names and path elements separated by '/' characters. This is not enforced see CleanName on how to ensure names are valid if this is desired. |
| versionRequiredToExtract | The minimum 'feature version' required this entry |
| ArgumentNullException | The name passed is null |
|
package |
Initializes an entry with the given name and made by information.
| name | Name for this entry |
| madeByInfo | Version and HostSystem Information |
| versionRequiredToExtract | Minimum required zip feature version required to extract this entry |
| method | Compression method for this entry. |
| ArgumentNullException | The name passed is null |
| ArgumentOutOfRangeException | versionRequiredToExtract should be 0 (auto-calculate) or > 10 |
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.
| ICSharpCode.SharpZipLib.Zip.ZipEntry.ZipEntry | ( | ZipEntry | entry | ) |
Creates a deep copy of the given zip entry.
| entry | The entry to copy. |

|
static |
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.
| name | The name to clean |
The
Zip name transform
class is more flexible.
| object ICSharpCode.SharpZipLib.Zip.ZipEntry.Clone | ( | ) |
Creates a copy of this zip entry.


| void ICSharpCode.SharpZipLib.Zip.ZipEntry.ForceZip64 | ( | ) |
Force this entry to be recorded using Zip64 extensions.

|
private |
Test the external attributes for this ZipEntry to see if the external attributes are Dos based (including WINNT and variants) and match the values.
| attributes | The attributes to test. |
| bool ICSharpCode.SharpZipLib.Zip.ZipEntry.IsCompressionMethodSupported | ( | ) |
Test entry to see if data can be extracted.


|
static |
Test a compression method to see if this library supports extracting data compressed with that method.
| method | The compression method to test. |
| bool ICSharpCode.SharpZipLib.Zip.ZipEntry.IsZip64Forced | ( | ) |
Get a value indicating wether Zip64 extensions were forced.

|
private |


|
package |
Process extra data fields updating the entry based on the contents.
| localHeader | True if the extra data fields should be handled for a local header, rather than for a central header. |


| override string ICSharpCode.SharpZipLib.Zip.ZipEntry.ToString | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
getpackage |
AES Encryption strength for storage in extra data in entry header. 1 is 128 bit, 2 is 192 bit, 3 is 256 bit.
|
getset |
For AES encrypted files returns or sets the number of bits of encryption (128, 192 or 256). When setting, only 0 (off), 128 or 256 is supported.
|
getpackage |
Number of extra bytes required to hold the AES Header fields (Salt, Pwd verify, AuthCode)
|
getpackage |
Returns the length of the salt, in bytes.
|
get |
Get a value indicating whether this entry can be decompressed by the library.
This is based on the Version and wether the compression method is supported.
|
get |
Get a value indicating wether the central directory entry requires Zip64 extensions to be stored.
|
getset |
Gets/Sets the entry comment.
| System.ArgumentOutOfRangeException | If comment is longer than 0xffff. |
A comment is only available for entries when read via the ZipFile class. The ZipInputStream class doesnt have the comment data available.
|
getset |
Gets/Sets the size of the compressed data.
|
getset |
Gets/Sets the compression method. Only Deflated and Stored are supported.
ICSharpCode.SharpZipLib.Zip.CompressionMethod.Deflated ICSharpCode.SharpZipLib.Zip.CompressionMethod.Stored
|
getpackage |
Gets the compression method for outputting to the local or central header. Returns same value as CompressionMethod except when AES encrypting, which places 99 in the method and places the real method in the extra data.
|
getset |
Gets/Sets the crc of the uncompressed data.
| System.ArgumentOutOfRangeException | Crc is not in the range 0..0xffffffffL |
|
getsetpackage |
Value used during password checking for PKZIP 2.0 / 'classic' encryption.
|
getset |
Gets/Sets the time of last modification of the entry.
The DosTime property is updated to match this as far as possible.
|
getset |
Get/Set DosTime value.
The MS-DOS date format can only represent dates between 1/1/1980 and 12/31/2107.
|
getset |
Get/Set external file attributes as an integer. The values of this are operating system dependant see HostSystem for details.
|
getset |
Gets/Sets the extra data.
| System.ArgumentOutOfRangeException | Extra data is longer than 64KB (0xffff) bytes. |
|
getset |
Get/Set general purpose bit flag for entry.
General purpose bit flag
Bit 0: If set, indicates the file is encrypted
Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating
Imploding:
Bit 1 if set indicates an 8K sliding dictionary was used. If clear a 4k dictionary was used
Bit 2 if set indicates 3 Shannon-Fanno trees were used to encode the sliding dictionary, 2 otherwise
Deflating:
Bit 2 Bit 1
0 0 Normal compression was used
0 1 Maximum compression was used
1 0 Fast compression was used
1 1 Super fast compression was used
Bit 3: If set, the fields crc-32, compressed size and uncompressed size are were not able to be written during zip file creation The correct values are held in a data descriptor immediately following the compressed data.
Bit 4: Reserved for use by PKZIP for enhanced deflating
Bit 5: If set indicates the file contains compressed patch data
Bit 6: If set indicates strong encryption was used.
Bit 7-10: Unused or reserved
Bit 11: If set the name and comments for this entry are in unicode.
Bit 12-15: Unused or reserved
|
get |
Get a value indicating wether the entry has a CRC value available.
|
getset |
Gets the compatability information for the external file attribute If the external file attributes are compatible with MS-DOS and can be read by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value will be non-zero and identify the host system on which the attributes are compatible.
The values for this as defined in the Zip File format and by others are shown below. The values are somewhat misleading in some cases as they are not all used as shown. You should consult the relevant documentation to obtain up to date and correct information. The modified appnote by the infozip group is particularly helpful as it documents a lot of peculiarities. The document is however a little dated.
- MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) 1 - Amiga 2 - OpenVMS 3 - Unix 4 - VM/CMS 5 - Atari ST 6 - OS/2 HPFS 7 - Macintosh 8 - Z-System 9 - CP/M 10 - Windows NTFS 11 - MVS (OS/390 - Z/OS) 12 - VSE 13 - Acorn Risc 14 - VFAT 15 - Alternate MVS 16 - BeOS 17 - Tandem 18 - OS/400 19 - OS/X (Darwin) 99 - WinZip AES remainder - unused
|
getset |
|
get |
Gets a value indicating if the entry is a directory. however.
A directory is determined by an entry name with a trailing slash '/'. The external file attributes can also indicate an entry is for a directory. Currently only dos/windows attributes are tested in this manner. The trailing slash convention should always be followed.
|
get |
Get a value indicating this entry is for a DOS/Windows system.
|
get |
Get a value of true if the entry appears to be a file; false otherwise.
This only takes account of DOS/Windows attributes. Other operating systems are ignored. For linux and others the result may be incorrect.
|
getset |
Get / set a flag indicating wether entry name and comment text are encoded in unicode UTF8.
This is an assistant that interprets the flags property.
|
get |
Gets a value indicating if the entry requires Zip64 extensions to store the full entry values.
A bool value of true if a local header requires Zip64 extensions; false if not.
|
get |
Returns the entry name.
The unix naming convention is followed. Path components in the entry should always separated by forward slashes ('/'). Dos device names like C: should also be removed. See the ZipNameTransform class, or CleanName(string) /remarks>
|
getset |
Get/set offset for use in central header.
|
getset |
Gets/Sets the size of the uncompressed data.
Setting the size before adding an entry to an archive can help avoid compatability problems with some archivers which dont understand Zip64 extensions.
|
get |
Get minimum Zip feature version required to extract this entry.
Minimum features are defined as:
1.0 - Default value
1.1 - File is a volume label
2.0 - File is a folder/directory
2.0 - File is compressed using Deflate compression
2.0 - File is encrypted using traditional encryption
2.1 - File is compressed using Deflate64
2.5 - File is compressed using PKWARE DCL Implode
2.7 - File is a patch data set
4.5 - File uses Zip64 format extensions
4.6 - File is compressed using BZIP2 compression
5.0 - File is encrypted using DES
5.0 - File is encrypted using 3DES
5.0 - File is encrypted using original RC2 encryption
5.0 - File is encrypted using RC4 encryption
5.1 - File is encrypted using AES encryption
5.1 - File is encrypted using corrected RC2 encryption
5.1 - File is encrypted using corrected RC2-64 encryption
6.1 - File is encrypted using non-OAEP key wrapping
6.2 - Central directory encryption (not confirmed yet)
6.3 - File is compressed using LZMA
6.3 - File is compressed using PPMD+
6.3 - File is encrypted using Blowfish
6.3 - File is encrypted using Twofish
|
get |
Get the version made by for this entry or zero if unknown. The value / 10 indicates the major version number, and the value mod 10 is the minor version number.
|
getset |