[
https://issues.apache.org/jira/browse/COMPRESS-458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16533646#comment-16533646
]
Stefan Bodewig commented on COMPRESS-458:
-----------------------------------------
I had a look at the implementation in OpenJDK 10, they don't store the times
inside the extra array directly but in fields and {{ZipOutputStream}} reads
those fields creating extra fields on the fly (extended timestamp if the times
are small enough and NTFS if they are too big).
Yes, we could probably implement setters as well as getters (I briefly was
under the wrong impression the methods would use {{java.time}} types, but they
use {{FileTime}} which is part of Java7). What won't work is properly
implementing the constructor accepting a {{ZipEntry}}.
> Deal with lastAccessTime and creationTime in ZipArchiveEntry
> ------------------------------------------------------------
>
> Key: COMPRESS-458
> URL: https://issues.apache.org/jira/browse/COMPRESS-458
> Project: Commons Compress
> Issue Type: Improvement
> Components: Archivers
> Affects Versions: 1.17
> Reporter: Stefan Bodewig
> Priority: Major
> Labels: zip
>
> With Java8 {{ZipEntry}} has new getters and setters for the last access time
> and file creation time are backed by at least one of the extra fields
> ExtendedTimeStamp or NTFS (potentially by both of them). {{ZipArchiveEntry}}
> inherits those methods when running on Java8+ and users expect them to work,
> which they don't in our implementation. Unfortunately the internal
> implementation of the setters seems to modify the extra data in {{ZipEntry}}
> directly so the extra fields are not visible to {{ZipArchiveEntry}} which
> shadows the extra data held by the super class
> Unless we want to fiddle with reflection a proper implementation will only be
> possible once Compress requires Java8. Once we are there we should override
> the methods to properly create extra fields ourselves in the setters and
> parse them inside the getters.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)