From 552741c9800d0c990e04c4905ed8b0e9d31690e4 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Wed, 24 Aug 2011 12:02:14 -0700 Subject: [PATCH] [FIXED JENKINS-10805] preserve the timestampa as well as permissions --- changelog.html | 3 +++ core/src/main/java/hudson/FilePath.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 5ca84606e7..31a65f5f6c 100644 --- a/changelog.html +++ b/changelog.html @@ -61,6 +61,9 @@ Upcoming changes
  • Fixed NPE in running assembly:assembly with Maven3 (issue 8837) +
  • + Fixed a bug in one of the file copy operations that caused the copy-artifact plugin to fail to preserve the timestamp. + (issue 10805) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 6c95fc9435..6467a16924 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -1392,13 +1392,14 @@ public final class FilePath implements Serializable { } /** - * Copies this file to the specified target, with file permissions intact. + * Copies this file to the specified target, with file permissions and other meta attributes intact. * @since 1.311 */ public void copyToWithPermission(FilePath target) throws IOException, InterruptedException { copyTo(target); // copy file permission target.chmod(mode()); + target.touch(lastModified()); } /** -- GitLab