Skip to content

Commit

Permalink
[FIXED JENKINS-10805] preserve the timestampa as well as permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Aug 24, 2011
1 parent 4f3a285 commit 552741c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -61,6 +61,9 @@
<li class=bug>
Fixed NPE in running <tt>assembly:assembly</tt> with Maven3
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-8837">issue 8837</a>)
<li class=bug>
Fixed a bug in one of the file copy operations that caused the copy-artifact plugin to fail to preserve the timestamp.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-10805">issue 10805</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/FilePath.java
Expand Up @@ -1392,13 +1392,14 @@ public void copyTo(FilePath target) throws IOException, InterruptedException {
}

/**
* 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());
}

/**
Expand Down

0 comments on commit 552741c

Please sign in to comment.