extractZip

fun extractZip(zipFile: File, targetDir: File)

Extracts a ZIP archive to a target directory with Zip-Slip protection.

Parameters

zipFile

The ZIP archive to extract.

targetDir

The directory to extract into (created if it does not exist).

Throws

if any entry escapes the target directory.