提交 552741c9 编写于 作者: K Kohsuke Kawaguchi

[FIXED JENKINS-10805] preserve the timestampa as well as permissions

上级 4f3a285a
......@@ -61,6 +61,9 @@ Upcoming changes</a>
<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=-->
......
......@@ -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());
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册