klyn.io.archives.Archiver.unpackArchive
method
public unpackArchive(archivePath as String, destinationPath as Path, mode as FileAccessMode = FileAccessMode.CREATE_NEW) as Void throws IOException:
Description

Unpacks an archive into a destination represented by a Path. This overload preserves the selected archiver's validation and creation policy; the destination need not exist yet.

Parameters
ParameterDescription
archivePathArchive file to unpack.
destinationPathDestination directory path.
modeTarget creation policy.
Throws
  • IOException if the destination is null or extraction fails.
Example
archiver = Archiver.getInstance(ArchiveFormat.ZIP)
destination = Path.tempDir.resolve("reports")
archiver.unpackArchive("reports.zip", destination, FileAccessMode.OVERWRITE)