Skip to content

Commit

Permalink
deps: update dependency org.apache.commons:commons-compress to v1.26.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and sschuberth committed Feb 19, 2024
1 parent bf5661b commit 659b302
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ versionsPlugin = "0.51.0"
asciidoctorj = "2.5.11"
asciidoctorjPdf = "2.3.13"
clikt = "4.2.2"
commonsCompress = "1.25.0"
commonsCompress = "1.26.0"
cvssCalculator = "1.4.2"
cyclonedx = "8.0.3"
diffUtils = "4.12"
Expand Down
6 changes: 3 additions & 3 deletions utils/common/src/main/kotlin/ArchiveUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fun File.unpackTryAllTypes(targetDirectory: File, filter: (ArchiveEntry) -> Bool
* and all entries not matched by the given [filter].
*/
fun File.unpack7Zip(targetDirectory: File, filter: (ArchiveEntry) -> Boolean = { true }) {
SevenZFile(this).use { zipFile ->
SevenZFile.Builder().setFile(this).get().use { zipFile ->
val canonicalTargetDirectory = targetDirectory.canonicalFile

while (true) {
Expand Down Expand Up @@ -162,13 +162,13 @@ 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(SeekableInMemoryByteChannel(this)).unpack(targetDirectory, filter)
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].
*/
fun File.unpackZip(targetDirectory: File, filter: (ArchiveEntry) -> Boolean = { true }) =
ZipFile(this).unpack(targetDirectory, filter)
ZipFile.Builder().setFile(this).get().unpack(targetDirectory, filter)

/**
* Unpack the [ZipFile]. In contrast to [InputStream.unpackZip] this properly parses the ZIP's central directory, see
Expand Down

0 comments on commit 659b302

Please sign in to comment.