New to Telerik Document ProcessingStart a free 30-day trial

Represents a compressed file within a zip archive.

Definition

Namespace:Telerik.Windows.Zip

Assembly:Telerik.Windows.Zip.dll

Syntax:

C#
public class ZipArchiveEntry : IDisposable, INotifyPropertyChanged

Inheritance: objectZipArchiveEntry

Implements: IDisposableINotifyPropertyChanged

Events

Occurs when a property value changes.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged

Methods

Deletes the entry from the zip archive.

C#
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.

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

C#
public void Dispose()

Implements: IDisposable.Dispose()

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.

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

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

Opens the entry from the zip archive.

C#
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.

Properties

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

C#
public ZipArchive Archive { get; set; }

Gets compressed size of the entry in the zip archive.

C#
public long CompressedLength { get; }

Gets or sets external file attributes.

C#
public int ExternalAttributes { get; set; }

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

C#
public string FullName { get; }

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

C#
public DateTimeOffset LastWriteTime { get; set; }

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

C#
public long Length { get; }

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

C#
public string Name { get; }

Extension Methods