Method | Description | |
---|---|---|
Extract ( ) : void |
Extract the entry to the filesystem, starting at the current working directory. This method extracts an entry from a zip file into the current working directory. The path of the entry as extracted is the full path as specified in the zip archive, relative to the current working directory. After the file is extracted successfully, the file attributes and timestamps are set. The action taken when extraction an entry would overwrite an existing file is determined by the Within the call to |
|
Extract ( ExtractExistingFileAction extractExistingFile ) : void |
Extract the entry to a file in the filesystem, using the specified behavior when extraction would overwrite an existing file. See the remarks on the LastModified property, for some details about how the last modified time of the file is set after extraction. |
|
Extract ( Stream stream ) : void |
Extracts the entry to the specified stream. The caller can specify any write-able stream, for example a The position on the stream is not reset by this method before it extracts. You may want to call stream.Seek() before calling ZipEntry.Extract(). |
|
Extract ( string baseDirectory ) : void |
Extract the entry to the filesystem, starting at the specified base directory. Using this method, existing entries in the filesystem will not be overwritten. If you would like to force the overwrite of existing files, see the ExtractExistingFile property, or call Extract(string, ExtractExistingFileAction). See the remarks on the LastModified property, for some details about how the last modified time of the created file is set. |
|
Extract ( string baseDirectory, ExtractExistingFileAction extractExistingFile ) : void |
Extract the entry to the filesystem, starting at the specified base directory, and using the specified behavior when extraction would overwrite an existing file. See the remarks on the LastModified property, for some details about how the last modified time of the created file is set. |
|
ExtractWithPassword ( ExtractExistingFileAction extractExistingFile, string password ) : void |
Extract the entry to a file in the filesystem, relative to the current directory, using the specified behavior when extraction would overwrite an existing file. See the remarks on the LastModified property, for some details about how the last modified time of the created file is set. |
|
ExtractWithPassword ( Stream stream, string password ) : void |
Extracts the entry to the specified stream, using the specified Password. For example, the caller could extract to Console.Out, or to a MemoryStream. The caller can specify any write-able stream, for example a The position on the stream is not reset by this method before it extracts. You may want to call stream.Seek() before calling ZipEntry.Extract(). |
|
ExtractWithPassword ( string password ) : void |
Extract the entry to the filesystem, using the current working directory and the specified password. Existing entries in the filesystem will not be overwritten. If you would like to force the overwrite of existing files, see the See the remarks on the LastModified property for some details about how the "last modified" time of the created file is set. |
|
ExtractWithPassword ( string baseDirectory, ExtractExistingFileAction extractExistingFile, string password ) : void |
Extract the entry to the filesystem, starting at the specified base directory, and using the specified behavior when extraction would overwrite an existing file. See the remarks on the LastModified property, for some details about how the last modified time of the created file is set. |
|
ExtractWithPassword ( string baseDirectory, string password ) : void |
Extract the entry to the filesystem, starting at the specified base directory, and using the specified password. Existing entries in the filesystem will not be overwritten. If you would like to force the overwrite of existing files, see the See the remarks on the LastModified property, for some details about how the last modified time of the created file is set. |
|
OpenReader ( ) : Crisis.Ionic.Crc.CrcCalculatorStream |
Opens a readable stream corresponding to the zip entry in the archive. The stream decompresses and decrypts as necessary, as it is read. DotNetZip offers a variety of ways to extract entries from a zip file. This method allows an application to extract an entry by reading a System.IO.Stream. The return value is of type If the entry is protected with a password, then you need to provide a password prior to calling OpenReader(), either by setting the Password property on the entry, or the ZipFile.Password property on the If you want to extract entry data into a write-able stream that is already opened, like a System.IO.FileStream, do not use this method. Instead, use Extract(Stream). Your application may use only one stream created by OpenReader() at a time, and you should not call other Extract methods before completing your reads on a stream obtained from OpenReader(). This is because there is really only one source stream for the compressed content. A call to OpenReader() seeks in the source stream, to the beginning of the compressed content. A subsequent call to OpenReader() on a different entry will seek to a different position in the source stream, as will a call to Extract() or one of its overloads. This will corrupt the state for the decompressing stream from the original call to OpenReader(). The |
|
OpenReader ( string password ) : Crisis.Ionic.Crc.CrcCalculatorStream |
Opens a readable stream for an encrypted zip entry in the archive. The stream decompresses and decrypts as necessary, as it is read. See the documentation on the OpenReader() method for full details. This overload allows the application to specify a password for the |
|
SetEntryTimes ( System.DateTime created, System.DateTime accessed, System.DateTime modified ) : void |
Sets the NTFS Creation, Access, and Modified times for the given entry. When adding an entry from a file or directory, the Creation, Access, and Modified times for the given entry are automatically set from the filesystem values. When adding an entry from a stream or string, the values are implicitly set to DateTime.Now. The application may wish to set these values to some arbitrary value, before saving the archive, and can do so using the various setters. If you want to set all of the times, this method is more efficient. The values you set here will be retrievable with the When this method is called, if both DateTime values provided here without a DateTimeKind are assumed to be Local Time. |
|
ToString ( ) : String |
Provides a string representation of the instance.
|
|
ZipEntry ( ) : System |
Default constructor. Applications should never need to call this directly. It is exposed to support COM Automation environments. |
Method | Description | |
---|---|---|
CalcWinZipAesMac ( Stream input ) : void | ||
CheckExtractExistingFile ( string baseDir, string targetFileName ) : int | ||
ConstructExtraField ( bool forCentralDirectory ) : byte[] | ||
CopyMetaData ( |
Copy metadata that may have been changed by the app. We do this when resetting the zipFile instance. If the app calls Save() on a ZipFile, then tries to party on that file some more, we may need to Reset() it , which means re-reading the entries and then copying the metadata. I think.
|
|
CopyThroughOneEntry ( Stream outStream ) : void | ||
CopyThroughWithNoChange ( Stream outstream ) : void | ||
CopyThroughWithRecompute ( Stream outstream ) : void | ||
Create ( string nameInArchive, ZipEntrySource source, Object arg1, Object arg2 ) : |
||
CreateForJitStreamProvider ( string nameInArchive, OpenDelegate opener, CloseDelegate closer ) : |
||
CreateForStream ( String entryName, Stream s ) : |
||
CreateForWriter ( String entryName, WriteDelegate d ) : |
||
CreateForZipOutputStream ( string nameInArchive ) : |
||
CreateFromFile ( String filename, string nameInArchive ) : |
||
CreateFromNothing ( String nameInArchive ) : |
||
ExtractOne ( Stream output ) : |
||
FigureCrc32 ( ) : |
||
FileNameIsUtf8 ( char FileNameChars ) : bool | ||
FindExtraFieldSegment ( byte extra, int offx, |
Finds a particular segment in the given extra field. This is used when modifying a previously-generated extra field, in particular when removing the AES crypto segment in the extra field.
|
|
FinishOutputStream ( Stream s, |
||
GetEncodedFileNameBytes ( ) : byte[] |
generate and return a byte array that encodes the filename for the entry. side effects: generate and store into _CommentBytes the byte array for any comment attached to the entry. Also sets _actualEncoding to indicate the actual encoding used. The same encoding is used for both filename and comment. |
|
GetExtractDecompressor ( Stream input2 ) : Stream | ||
GetExtractDecryptor ( Stream input ) : Stream | ||
GetKeyStrengthInBits ( EncryptionAlgorithm a ) : int | ||
GetLengthOfCryptoHeaderBytes ( EncryptionAlgorithm a ) : int | ||
HandlePK00Prefix ( Stream s ) : void | ||
HandleUnexpectedDataDescriptor ( |
||
InternalExtract ( string baseDir, Stream outstream, string password ) : void | ||
InternalOpenReader ( string password ) : Crisis.Ionic.Crc.CrcCalculatorStream | ||
IsNotValidSig ( int signature ) : bool | ||
IsNotValidZipDirEntrySig ( int signature ) : bool |
Returns true if the passed-in value is a valid signature for a ZipDirEntry.
|
|
MarkAsDirectory ( ) : void | ||
MaybeApplyCompression ( Stream s, long streamLength ) : Stream | ||
MaybeApplyEncryption ( Stream s ) : Stream | ||
MaybeUnsetCompressionMethodForWriting ( int cycle ) : void | ||
NameInArchive ( String filename, string directoryPathInArchive ) : string |
/// The text encoding actually used for this ZipEntry. /// /// /// /// This read-only property describes the encoding used by the /// /// If the entry is being created, then the value of ActualEncoding is taken /// according to the logic described in the documentation for /// An application might be interested in retrieving this property to see if /// an entry read in from a file has used Unicode (UTF-8). /// /// |
|
NormalizeFileName ( ) : string | ||
NotifySaveComplete ( ) : void | ||
OnAfterExtract ( string path ) : void | ||
OnBeforeExtract ( string path ) : void | ||
OnExtractExisting ( string path ) : void | ||
OnExtractProgress ( System.Int64 bytesWritten, System.Int64 totalBytesToWrite ) : void | ||
OnWriteBlock ( System.Int64 bytesXferred, System.Int64 totalBytesToXfer ) : void | ||
OnZipErrorWhileSaving ( |
||
PostProcessOutput ( Stream s ) : void | ||
PrepOutputStream ( Stream s, long streamLength, |
Prepare the given stream for output - wrap it in a CountingStream, and then in a CRC stream, and an encryptor and deflator as appropriate. Previously this was used in ZipEntry.Write(), but in an effort to introduce some efficiencies in that method I've refactored to put the code inline. This method still gets called by ZipOutputStream. |
|
PrepSourceStream ( ) : void |
Stores the position of the entry source stream, or, if the position is already stored, seeks to that position. This method is called in prep for reading the source stream. If PKZIP encryption is used, then we need to calc the CRC32 before doing the encryption, because the CRC is used in the 12th byte of the PKZIP encryption header. So, we need to be able to seek backward in the source when saving the ZipEntry. This method is called from the place that calculates the CRC, and also from the method that does the encryption of the file data. The first time through, this method sets the _sourceStreamOriginalPosition field. Subsequent calls to this method seek to that position. |
|
ProcessExtraField ( Stream s, |
At current cursor position in the stream, read the extra field, and set the properties on the ZipEntry instance appropriately. This can be called when processing the Extra field in the Central Directory, or in the local header.
|
|
ProcessExtraFieldInfoZipTimes ( byte buffer, int j, |
||
ProcessExtraFieldPkwareStrongEncryption ( byte Buffer, int j ) : int | ||
ProcessExtraFieldUnixTimes ( byte buffer, int j, |
||
ProcessExtraFieldWinZipAes ( byte buffer, int j, |
||
ProcessExtraFieldWindowsTimes ( byte buffer, int j, |
||
ProcessExtraFieldZip64 ( byte buffer, int j, |
||
ReadDirEntry ( |
Reads one entry from the zip directory structure in the zip file.
|
|
ReadEntry ( |
Reads one
|
|
ReadExtraField ( ) : void | ||
ReadHeader ( |
||
ReadWeakEncryptionHeader ( Stream s, byte buffer ) : int | ||
ReallyDelete ( string fileName ) : void | ||
ResetDirEntry ( ) : void | ||
SetFdpLoh ( ) : void | ||
SetInputAndFigureFileLength ( Stream &input ) : long |
Set the input stream and get its length, if possible. The length is used for progress updates, AND, to allow an optimization in case of a stream/file of zero length. In that case we skip the Encrypt and compression Stream. (like DeflateStream or BZip2OutputStream)
|
|
SetZip64Flags ( ) : void | ||
SetupCryptoForExtract ( string password ) : void | ||
StoreRelativeOffset ( ) : void | ||
TraceWriteLine ( string format ) : void | ||
ValidateCompression ( ) : void | ||
ValidateEncryption ( ) : void | ||
ValidateOutput ( string basedir, Stream outstream, string &outFileName ) : bool |
Validates that the args are consistent. Only one of {baseDir, outStream} can be non-null. If baseDir is non-null, then the outputFile is created. |
|
VerifyCrcAfterExtract ( |
||
WantReadAgain ( ) : bool | ||
Write ( Stream s ) : void | ||
WriteCentralDirectoryEntry ( Stream s ) : void | ||
WriteHeader ( Stream s, int cycle ) : void | ||
WriteSecurityMetadata ( Stream outstream ) : void | ||
WriteStatus ( string format ) : void | ||
_CheckRead ( int nbytes ) : void | ||
_SetTimes ( string fileOrDirectory, bool isFile ) : void | ||
_WriteEntryData ( Stream s ) : void |
public Extract ( ExtractExistingFileAction extractExistingFile ) : void | ||
extractExistingFile | ExtractExistingFileAction | /// The action to take if extraction would overwrite an existing file. /// |
return | void |
public Extract ( Stream stream ) : void | ||
stream | Stream | /// the stream to which the entry should be extracted. /// |
return | void |
public Extract ( string baseDirectory ) : void | ||
baseDirectory | string | the pathname of the base directory |
return | void |
public Extract ( string baseDirectory, ExtractExistingFileAction extractExistingFile ) : void | ||
baseDirectory | string | the pathname of the base directory |
extractExistingFile | ExtractExistingFileAction | /// The action to take if extraction would overwrite an existing file. /// |
return | void |
public ExtractWithPassword ( ExtractExistingFileAction extractExistingFile, string password ) : void | ||
extractExistingFile | ExtractExistingFileAction | /// The action to take if extraction would overwrite an existing file. /// |
password | string | The Password to use for decrypting the entry. |
return | void |
public ExtractWithPassword ( Stream stream, string password ) : void | ||
stream | Stream | /// the stream to which the entry should be extracted. /// |
password | string | /// The password to use for decrypting the entry. /// |
return | void |
public ExtractWithPassword ( string password ) : void | ||
password | string | The Password to use for decrypting the entry. |
return | void |
public ExtractWithPassword ( string baseDirectory, ExtractExistingFileAction extractExistingFile, string password ) : void | ||
baseDirectory | string | the pathname of the base directory |
extractExistingFile | ExtractExistingFileAction | The action to take if extraction would /// overwrite an existing file. |
password | string | The Password to use for decrypting the entry. |
return | void |
public ExtractWithPassword ( string baseDirectory, string password ) : void | ||
baseDirectory | string | The pathname of the base directory. |
password | string | The Password to use for decrypting the entry. |
return | void |
public OpenReader ( ) : Crisis.Ionic.Crc.CrcCalculatorStream | ||
return | Crisis.Ionic.Crc.CrcCalculatorStream |
public OpenReader ( string password ) : Crisis.Ionic.Crc.CrcCalculatorStream | ||
password | string | The password to use for decrypting the entry. |
return | Crisis.Ionic.Crc.CrcCalculatorStream |
public SetEntryTimes ( System.DateTime created, System.DateTime accessed, System.DateTime modified ) : void | ||
created | System.DateTime | the creation time of the entry. |
accessed | System.DateTime | the last access time of the entry. |
modified | System.DateTime | the last modified time of the entry. |
return | void |