unpackZipEntry

private fun unpackZipEntry(unpackDirectory: String, zipInputStream: ZipInputStream, zipEntry: ZipEntry, totalUnpackedBytes: Long): Long

Validates and extracts a single zip entry under unpackDirectory. Throws IllegalStateException from validateChildFileExistsUnderParent if the entry name would resolve outside of unpackDirectory, and IOException from copyZipEntryToOutputStream if the entry or the cumulative archive exceed their size limits. Directory entries are created; file entries are written to disk.

Return

the updated cumulative byte total after processing zipEntry.

Parameters

unpackDirectory

the absolute destination directory for the archive.

zipInputStream

the active zip stream positioned at zipEntry.

zipEntry

the entry currently being processed.

totalUnpackedBytes

cumulative bytes written across previously extracted entries.