klyn.io.archives.ZipArchiver.unpackArchive
method

    public native override unpackArchive(archivePath as String, destinationPath as String, mode as FileAccessMode = FileAccessMode.CREATE_NEW) as Void throws IOException

Description

Extracts a ZIP archive into a directory.

`CREATE_NEW` rejects an existing destination. `OVERWRITE` atomically replaces it after every entry has been extracted and validated.

Parameters

Parameter | Description
--- | ---
`archivePath` | ZIP file to extract.
`destinationPath` | Destination directory.
`mode` | Target directory creation policy.

Throws

- IOException if archive input/output fails, paths are invalid, or the requested archive mode cannot be honored.

Example

    zip = ZipArchiver()
    zip.unpackArchive("reports.zip", "/tmp/reports", FileAccessMode.OVERWRITE)