You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/04/02 16:21:00 UTC

[jira] [Commented] (COMPRESS-617) ZipArchiveOutputStream should use last modification time (mtime) of ZipEntry

    [ https://issues.apache.org/jira/browse/COMPRESS-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17516336#comment-17516336 ] 

Gary D. Gregory commented on COMPRESS-617:
------------------------------------------

See the recent work in the TAR format in git master for [COMPRESS-612]

Is this the kind of improvement you have in mind? Feel free to provide a PR on GitHub :)

> ZipArchiveOutputStream should use last modification time (mtime) of ZipEntry
> ----------------------------------------------------------------------------
>
>                 Key: COMPRESS-617
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-617
>             Project: Commons Compress
>          Issue Type: Task
>          Components: Archivers
>    Affects Versions: 1.21
>            Reporter: Jorge Solórzano
>            Priority: Major
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)