Skip to content

Commit

Permalink
chore(common-utils)!: Remove the unused ByteArray.unpackZip() function
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Feb 22, 2024
1 parent 58332a0 commit 35ec89e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions utils/common/src/main/kotlin/ArchiveUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import org.apache.commons.compress.archivers.zip.ZipFile
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
import org.apache.commons.compress.compressors.xz.XZCompressorInputStream
import org.apache.commons.compress.utils.SeekableInMemoryByteChannel
import org.apache.logging.log4j.kotlin.logger

enum class ArchiveType(extension: String, vararg aliases: String) {
Expand Down Expand Up @@ -158,12 +157,6 @@ fun File.unpack7Zip(targetDirectory: File, filter: (ArchiveEntry) -> Boolean = {
}
}

/**
* Unpack the [ByteArray] assuming it is a Zip archive, ignoring entries not matched by [filter].
*/
fun ByteArray.unpackZip(targetDirectory: File, filter: (ArchiveEntry) -> Boolean = { true }) =
ZipFile.Builder().setSeekableByteChannel(SeekableInMemoryByteChannel(this)).get().unpack(targetDirectory, filter)

/**
* Unpack the [File] assuming it is a Zip archive ignoring all entries not matched by [filter].
*/
Expand Down

0 comments on commit 35ec89e

Please sign in to comment.