Skip to content

Commit 8b1f135

Browse files
authored
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)
1 parent 50851a6 commit 8b1f135

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<wagon-gitsite.version>0.3.1</wagon-gitsite.version>
8888

8989
<!-- Dependency versions -->
90-
<commons-compress.version>1.21</commons-compress.version>
90+
<commons-compress.version>1.23.0</commons-compress.version>
9191
<junit.version>4.13.2</junit.version>
9292
<maven-plugin-annotations.version>3.6.0</maven-plugin-annotations.version>
9393
<maven-plugin-api.version>3.6.0</maven-plugin-api.version>

src/main/java/io/github/zlika/reproducible/ZipStripper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Map.Entry;
3131
import java.util.stream.Collectors;
3232

33+
import org.apache.commons.compress.archivers.zip.X000A_NTFS;
3334
import org.apache.commons.compress.archivers.zip.X5455_ExtendedTimestamp;
3435
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
3536
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
@@ -218,6 +219,10 @@ private ZipArchiveEntry filterZipEntry(ZipArchiveEntry entry)
218219
// Remove extended timestamps
219220
for (ZipExtraField field : entry.getExtraFields())
220221
{
222+
if (field instanceof X000A_NTFS)
223+
{
224+
entry.removeExtraField(field.getHeaderId());
225+
}
221226
if (field instanceof X5455_ExtendedTimestamp)
222227
{
223228
entry.removeExtraField(field.getHeaderId());

0 commit comments

Comments
 (0)