Unpack ZIP archive
Syntax
$binary.unzip()
Description
Unpacks a ZIP file and makes the contained files available as a list of JSON objects.
Parameters
| Name | Type | Type Description | Mandatory | Default |
|---|---|---|---|---|
| binary | Binary value | The ZIP file to be unpacked | Yes | - |
Return value
Type: List of JSON objects
An entry with the following fields for each file contained in the ZIP file:
-
The unpacked binary data of the entry.data -
The file name of the unpacked file.name -
commentAn optional comment -
compressedSizeThe size of the compressed content. -
crcThe CRC checksum of the content. -
extraOptional binary data assigned to the content. -
creationTimeThe date the content was last modified. -
lastAccessTimeThe date the content was last accessed. -
lastModifiedTimeThe date the content was last modified. -
methodThe compression method, either"deflated"or"stored". -
sizeThe unpacked size of the content.
Examples
Calculate total size
$zip.unzip().map(entry -> $entry["size"]).sum()
Output: The total size to be expected when unpacking the transferred ZIP file $zip.