ZipArchive Entry
ZipArchiveEntry represents every single compressed file within a zip archive.
What Is ZipArchiveEntry
The root element of the RadZipLibrary is the ZipArchive. The ZipArchive, on the other hand, consists of ZipArchiveEntries hosting all entries in the zip archive. You can Get ZipArchiveEntry or Create ZipArchiveEntry using the ZipArchive instance.
Properties
-
CompressedLength: Gets the compressed size of the entry in the zip archive.
The archive compressed length can be obtained only after the ZipArchiveEntry is disposed of, so in the following example, we are ensuring the correct disposing of the object by using statement.
Example 1: Get entry's compressed length
-
ExternalAttributes: Gets or sets external file attributes.
Example 2: Set entry's external attributes
-
FullName: Gets the relative path of the entry in the zip archive.
Example 3: Get entry's relative path
-
LastWriteTime: Gets or sets the last time the entry in the zip archive was changed.
Example 4: Set last entry's write time
-
Length: Gets the uncompressed size of the entry in the zip archive.
The archive length can be obtained only after the ZipArchiveEntry is disposed of, so in the following example, we are ensuring the correct disposing of the object by using statement.
Example 5: Get entry's length
-
Name: Gets the file name of the entry in the zip archive.
Example 6: Get entry's name
Methods
- Delete: Deletes the entry from the zip archive.
- Dispose: Releases the resources used by the current instance of the ZipArchiveEntry class.
- Open: Opens the entry from the zip archive.
Events
- PropertyChanged: Occurs when a property value changes.
ZipArchive and ZipArchiveEntry
There are several operations, which you can execute over a ZipArchive instance.
Get ZipArchiveEntry
Retrieves a wrapper for the specified entry in the zip archive.
Example 7: Get ZipArchiveEntry
Create ZipArchiveEntry
Creates an empty entry that has the specified path and entry name in the zip archive.
Example 8: Create ZipArchiveEntry
Extract ZipArchiveEntry
Extract an entry to a specific folder/directory.
Example 9: Extracting a ZipArchiveEntry to folder/directory
This functionality could be achieved by using the Zip Extensions' ExtractToFile method as well.
Operating with ZipArchiveEntry
Specific examples of using the ZipArchiveEntry.
Using ZipArchiveEntry Properties
A complete example including all the properties discussed above.