JDK-6303183 : Support NTFS and Unix-style timestamps for entries in Zip files
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-07-28
  • Updated: 2013-07-25
  • Resolved: 2013-05-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b94Fixed
Related Reports
Relates :  
Description
It is a source of repeated confusion that the timestamps stored in Zip files
are the ancient DOS timestamps with only 2 (!) seconds granularity.

Modern systems have timestamp granularity of seconds or milliseconds.

It is disturbing that archiving/unarchiving files in zip files causes the
timestamp to be rounded to the nearest 2 seconds, causing (mild) loss of user data,
and breaking makefiles and other programs relying on precise timestamps.

There are extensions to the zip file format supporting specific file systems
and their more precise timestamps.  It would be good for Java to support these
extensions, even though it would mean that zip files generated on Unix systems would
look a little different from zip files generated on Windows systems.

Comments
EVALUATION Agreed. See the zip file spec http://www.info-zip.org/pub/infozip/doc/ Java should generate the extended timestamp information appropriate to the platform, and should recognize the information when reading zip files created by other zip implementations. In particular, Unix and NTFS extended formats should be recognized. The documentation for java.util.zip classes such as ZipEntry should be clarified to explain about different timestamp granularities and the surprising 2-second DOS timestamps.
28-07-2005