public class ZipArchiver extends Archiver:
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)| Modifier and Type | Member | Description |
|---|---|---|
| public | ZipArchiverZipArchiver(): |
No summary. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native override | makeArchivemakeArchive(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 | unpackArchiveunpackArchive(archivePath as String, destinationPath as String, mode as FileAccessMode = FileAccessMode.CREATE_NEW) as Void throws IOException |
Extracts a ZIP archive into a directory. |