From 8b1f135bc25e4d0655e6b7541b79bed07cd05424 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sun, 18 Feb 2024 16:27:23 +0100 Subject: [PATCH] Update commons-compress to 1.23.0 (#66) commons-compress adds 0x000a headers with extended timestamps since https://issues.apache.org/jira/browse/COMPRESS-613 , remove those again (consistent with `X5455_ExtendedTimestamp`, and avoiding problems with timezone processing in particular situations) --- pom.xml | 2 +- src/main/java/io/github/zlika/reproducible/ZipStripper.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0c296c6..f3724cc 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 0.3.1 - 1.21 + 1.23.0 4.13.2 3.6.0 3.6.0 diff --git a/src/main/java/io/github/zlika/reproducible/ZipStripper.java b/src/main/java/io/github/zlika/reproducible/ZipStripper.java index ac4c72c..9193388 100644 --- a/src/main/java/io/github/zlika/reproducible/ZipStripper.java +++ b/src/main/java/io/github/zlika/reproducible/ZipStripper.java @@ -30,6 +30,7 @@ import java.util.Map.Entry; import java.util.stream.Collectors; +import org.apache.commons.compress.archivers.zip.X000A_NTFS; import org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestamp; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; @@ -218,6 +219,10 @@ private ZipArchiveEntry filterZipEntry(ZipArchiveEntry entry) // Remove extended timestamps for (ZipExtraField field : entry.getExtraFields()) { + if (field instanceof X000A_NTFS) + { + entry.removeExtraField(field.getHeaderId()); + } if (field instanceof X5455_ExtendedTimestamp) { entry.removeExtraField(field.getHeaderId());