Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-617

ZipArchiveOutputStream should use last modification time (mtime) of ZipEntry

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.21
    • None
    • Archivers
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jorsol Jorge Solórzano
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: