From 3ddd6bfc2bbfc8e2d4e6f6e22f00b32fb623843d Mon Sep 17 00:00:00 2001 From: Seiji Sogabe Date: Sun, 18 Mar 2012 08:04:14 +0900 Subject: [PATCH] [FIXED JENKINS-13122] Last modification date of files in a zip are not the original timestamps --- changelog.html | 7 +++++-- core/src/main/java/hudson/util/io/ZipArchiver.java | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.html b/changelog.html index 979531b623..48d89bf536 100644 --- a/changelog.html +++ b/changelog.html @@ -63,13 +63,16 @@ Upcoming changes (issue 13097)
  • Breadcrumb popup menu gives javascript error on Internet Explorer 8. - (issue 13082~ + (issue 13082)
  • Ajax on Update Center does not work in prototype 1.7
  • 'View as plain text' in Console Output is hidden by the new breadcrums bar +
  • + Last modification date of files in a zip are not the original timestamps + (issue 13122)
  • - Jenkins uses correct port in mDNS advertisement and shows up in Safari Bonjour bookmarks.
  • + Jenkins uses correct port in mDNS advertisement and shows up in Safari Bonjour bookmarks. diff --git a/core/src/main/java/hudson/util/io/ZipArchiver.java b/core/src/main/java/hudson/util/io/ZipArchiver.java index ae212b6a14..e5dd0648a9 100644 --- a/core/src/main/java/hudson/util/io/ZipArchiver.java +++ b/core/src/main/java/hudson/util/io/ZipArchiver.java @@ -61,11 +61,13 @@ final class ZipArchiver extends Archiver { // Setting this bit explicitly is needed by some unzipping applications (see JENKINS-3294). dirZipEntry.setExternalAttributes(BITMASK_IS_DIRECTORY); if (mode!=-1) dirZipEntry.setUnixMode(mode); + dirZipEntry.setTime(f.lastModified()); zip.putNextEntry(dirZipEntry); zip.closeEntry(); } else { ZipEntry fileZipEntry = new ZipEntry(relativePath); if (mode!=-1) fileZipEntry.setUnixMode(mode); + fileZipEntry.setTime(f.lastModified()); zip.putNextEntry(fileZipEntry); FileInputStream in = new FileInputStream(f); int len;