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
ParameterDescription
archivePathZIP file to extract.
destinationPathDestination directory.
modeTarget 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)