ZipArchiver
classin packageklyn.io.archives
public class ZipArchiver extends Archiver:
└ ZipArchiver

ZIP archive implementation.

This implementation writes ZIP32 containers and reads ZIP32 or ZIP64 containers directly through the Klyn runtime, without an external archive library. Files created by Klyn use the standard stored method. Extraction accepts both stored and DEFLATE entries, including archives that use ZIP data descriptors. CRC checks are always validated.

Extraction rejects encrypted entries, symbolic links, and paths that could escape the destination directory. Files are first extracted into a staging directory, so a malformed archive cannot partially replace an existing destination.

import klyn.io
import klyn.io.archives

zip = ZipArchiver()
zip.makeArchive("docs", "docs.zip", FileAccessMode.OVERWRITE)
zip.unpackArchive("docs.zip", "/tmp/docs", FileAccessMode.OVERWRITE)
Constructors
Modifier and Type Member Description
public ZipArchiver No summary.
Methods
Modifier and Type Member Description
public native override makeArchive
makeArchive(sourcePath as String, archivePath as String, mode as FileAccessMode = FileAccessMode.CREATE_NEW) as Void throws IOException
Creates a ZIP archive from a file or directory.
public native override unpackArchive
unpackArchive(archivePath as String, destinationPath as String, mode as FileAccessMode = FileAccessMode.CREATE_NEW) as Void throws IOException
Extracts a ZIP archive into a directory.
Inherited Methods
methodInherited Methods from Archiver: getInstance, makeArchive, unpackArchive