ZipReader Class
Contains methods to get information about zip entries and to extract content for specified zip entries from the zip file.
The following are constructors for ZipReader.
-
Creates a new instance of the
ZipReaderclass using the specified blob data.
Creates a new instance of the ZipReader class using the specified blob data.
global ZipReader(Blob data)
- data: Type: Blob Apex blob that contains the compressed content.
The following are methods for ZipReader.
-
Extracts the bytes for the specified zip entry name and decompresses the content.
-
Extracts the bytes for the specified zip entry and decompresses the content.
-
Gets a list of all the entries from the zip file.
-
Gets a map of names and the corresponding zip entries from the zip file.
-
Gets a zip entry for the specified name from the zip file.
-
Gets a list of all the zip entry names from the zip file.
Extracts the bytes for the specified zip entry name and decompresses the content.
public blob extract(string name)
- name: Type: string Species the zip entry name to extract and decompress.
Type: blob
Apex blob that contains the decompressed content.
Extracts the bytes for the specified zip entry and decompresses the content.
public blob extract(Compression.ZipEntry entry)
- entry: Type: Compression.ZipEntry Species the zip entry to extract and decompress.
Type: blob
Apex blob that contains the decompressed content.
Gets a list of all the entries from the zip file.
public List<compression.ZipEntry> getEntries()
Type: List<Compression.ZipEntry>
Gets a map of names and the corresponding zip entries from the zip file.
public Map<String,Compression.ZipEntry> getEntriesMap()
Type: Map<string,Compression.ZipEntry>
Gets a zip entry for the specified name from the zip file.
public compression.ZipEntry getEntry(string name)
- name: Type: string Name of the zip entry.
Type: Compression.ZipEntry
Throws a ZipException if the specified name isn’t found.
Gets a list of all the zip entry names from the zip file.
public List<String> getEntryNames()
Type: List<String>