klyn.io.archives.ZipArchiver.makeArchive
method

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

Description

Creates a ZIP archive from a file or directory.

Empty directories are preserved. `CREATE_NEW` rejects an existing archive; `OVERWRITE` replaces it.

Parameters

Parameter | Description
--- | ---
`sourcePath` | File or directory to archive.
`archivePath` | ZIP file to create.
`mode` | Target file creation policy.

Throws

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

Example

    zip = ZipArchiver()
    zip.makeArchive("reports", "reports.zip", FileAccessMode.OVERWRITE)