Details
-
Task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.21
-
None
-
None
Description
ZipArchiveOutputStream is a reimplementation of java.util.zip.ZipOutputStream, but since Java 8+ java.util.zip.ZipOutputStream supports setting extended timestamp fields in optional extra data in UTC time which ZipArchiveOutputStream do not use:
When output to a ZIP file or ZIP file formatted output stream the last modification time set by this method will be stored into zip file entry's date and time fields in standard MS-DOS date and time format), and the extended timestamp fields in optional extra data in UTC time.
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/zip/ZipEntry.html#setLastModifiedTime(java.nio.file.attribute.FileTime)
As such the reimplementation of ZipArchiveOutputStream should try to follow as close as possible the behavior of java.util.zip.ZipOutputStream.
So if I setLastModifiedTime(FileTime) in a ZipEntry, that time should add the extended timestamp fields in the ZipArchiveOutputStream.