Class
ZipArchiveEntry

Represents a compressed file within a zip archive.

Definition

Namespace:Telerik.Windows.Zip

Assembly:Telerik.Windows.Zip.dll

Syntax:

cs-api-definition
public class ZipArchiveEntry : IDisposable, INotifyPropertyChanged

Inheritance: objectZipArchiveEntry

Implements: IDisposableINotifyPropertyChanged

Properties

Archive

The zip archive that the entry belongs to, or null if the entry has been deleted.

Declaration

cs-api-definition
public ZipArchive Archive { get; set; }

Property Value

ZipArchive

CompressedLength

Gets compressed size of the entry in the zip archive.

Declaration

cs-api-definition
public long CompressedLength { get; }

Property Value

long

ExternalAttributes

Gets or sets external file attributes.

Declaration

cs-api-definition
public int ExternalAttributes { get; set; }

Property Value

int

FullName

Gets the relative path of the entry in the zip archive.

Declaration

cs-api-definition
public string FullName { get; }

Property Value

string

LastWriteTime

Gets or sets the last time the entry in the zip archive was changed.

Declaration

cs-api-definition
public DateTimeOffset LastWriteTime { get; set; }

Property Value

DateTimeOffset

Length

Gets the uncompressed size of the entry in the zip archive.

Declaration

cs-api-definition
public long Length { get; }

Property Value

long

Name

Gets the file name of the entry in the zip archive.

Declaration

cs-api-definition
public string Name { get; }

Property Value

string

Methods

Delete()

Deletes the entry from the zip archive.

Declaration

cs-api-definition
public void Delete()

Exceptions

IOException

The entry is already open for reading or writing.

NotSupportedException

The zip archive for this entry was opened in a mode other than Update.

ObjectDisposedException

The zip archive for this entry has been disposed.

Dispose()

Releases the resources used by the current instance of the ZipArchiveEntry class.

Declaration

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

Dispose(bool)

Called by the Dispose() and Finalize() methods to release the unmanaged resources used by the current instance of the ZipArchive class, and optionally finishes writing the archive and releases the managed resources.

Declaration

cs-api-definition
protected virtual void Dispose(bool disposing)

Parameters

disposing

bool

True to finish writing the archive and release unmanaged and managed resources; false to release only unmanaged resources.

Open()

Opens the entry from the zip archive.

Declaration

cs-api-definition
public Stream Open()

Returns

Stream

The stream that represents the contents of the entry.

Exceptions

IOException

The entry is already currently open for writing. -or- The entry has been deleted from the archive. -or- The archive for this entry was opened with the Create mode, and this entry has already been written to.

NotSupportedException

The entry is either missing from the archive or is corrupt and cannot be read. -or- The entry has been compressed by using a compression method that is not supported.

ObjectDisposedException

The zip archive for this entry has been disposed.

Remarks

The resulting stream depends on the zip archive mode. If zip archive mode is Create then read-only stream without seeking support is returned (CompressedStream). If zip archive mode is Read then write-only stream without seeking support is returned (CompressedStream). If zip archive mode is Update then read/write stream which supports seeking is returned.

Events

PropertyChanged

Occurs when a property value changes.

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged