Skip to content

Commit

Permalink
Update commons-compress to 1.23.0 (#66)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
raboof authored Feb 18, 2024
1 parent 50851a6 commit 8b1f135
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<wagon-gitsite.version>0.3.1</wagon-gitsite.version>

<!-- Dependency versions -->
<commons-compress.version>1.21</commons-compress.version>
<commons-compress.version>1.23.0</commons-compress.version>
<junit.version>4.13.2</junit.version>
<maven-plugin-annotations.version>3.6.0</maven-plugin-annotations.version>
<maven-plugin-api.version>3.6.0</maven-plugin-api.version>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/github/zlika/reproducible/ZipStripper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 8b1f135

Please sign in to comment.