You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Andre Brait (Jira)" <ji...@apache.org> on 2022/03/11 00:39:00 UTC
[jira] [Created] (COMPRESS-613) Write ZIP extra time fields automatically
Andre Brait created COMPRESS-613:
------------------------------------
Summary: Write ZIP extra time fields automatically
Key: COMPRESS-613
URL: https://issues.apache.org/jira/browse/COMPRESS-613
Project: Commons Compress
Issue Type: Improvement
Components: Archivers
Affects Versions: 1.21
Reporter: Andre Brait
When writing to a Zip file through ZipArchiveOutputStream, setting creation and access times in a ZipArchiveEntry does not cause these to be reflected as X5455 or X000A extra fields in the resulting zip file. This also happens for modification times that do not fit into an MS-DOS time.
As a consequence, the date range is reduced, as well as the granularity (form 100ns intervals to seconds).
ZipEntry and standard java.util.zip facilities do that automatically, but that's missing here.
My proposal is to use the same logic the java.util.zip do and add those extra fields automatically, if situation requires them.
See my existing logic for this here: https://github.com/andrebrait/DATROMTool/blob/86a4f4978bab250ca54d047c58b4f91e7dbbcc7f/core/src/main/java/io/github/datromtool/io/FileCopier.java#L1425
It's the same logic from java.util.zip, but adapted to be used with ZipArchiveEntry.
If you're ok with it, I can send a PR.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)