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:

  • data The unpacked binary data of the entry.

  • name The file name of the unpacked file.

  • comment An optional comment

  • compressedSize The size of the compressed content.

  • crc The CRC checksum of the content.

  • extra Optional binary data assigned to the content.

  • creationTime The date the content was last modified.

  • lastAccessTime The date the content was last accessed.

  • lastModifiedTime The date the content was last modified.

  • method The compression method, either "deflated" or "stored".

  • size The 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.