Newer Version Available
ZipReader Class
Contains methods to get information about zip entries and to extract content for
specified zip entries from the zip file.
Namespace
ZipReader Constructors
The following are constructors for ZipReader.
ZipReader(data)
Creates a new instance of the ZipReader class
using the specified blob data.
Signature
global ZipReader(Blob data)
Parameters
- data
- Type: Blob
- Apex blob that contains the compressed content.
ZipReader Methods
The following are methods for ZipReader.
extract(entry)
Extracts the bytes for the specified zip entry and decompresses the content.
Signature
public blob extract(Compression.ZipEntry entry)
Parameters
- entry
- Type: Compression.ZipEntry
- Species the zip entry to extract and decompress.
getEntries()
Gets a list of all the entries from the zip file.
Signature
public List<compression.ZipEntry> getEntries()
Return Value
Type: List<Compression.ZipEntry>
getEntriesMap()
Gets a map of names and the corresponding zip entries from the zip file.
Signature
public Map<String,Compression.ZipEntry> getEntriesMap()
Return Value
Type: Map<string,Compression.ZipEntry>
getEntry(name)
Gets a zip entry for the specified name from the zip file.
Signature
public compression.ZipEntry getEntry(string name)
Parameters
- name
- Type: string
- Name of the zip entry.
getEntryNames()
Gets a list of all the zip entry names from the zip file.
Signature
public List<String> getEntryNames()
Return Value
Type: List<String>