Permalink
Browse files

[FIXED JENKINS-11073] handle failure to set timestamp on Windows plat…

…forms more gracefully
  • Loading branch information...
kutzi committed Nov 12, 2011
1 parent 8f41302 commit a7ce870c1ad1a7ff67962ecfc9830949d9e2861d
Showing with 11 additions and 3 deletions.
  1. +11 −3 core/src/main/java/hudson/FilePath.java
@@ -61,8 +61,6 @@
import org.apache.commons.io.input.CountingInputStream;
import org.apache.commons.fileupload.FileItem;
import org.kohsuke.stapler.Stapler;
import org.jvnet.robust_http_client.RetryableHttpStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileFilter;
@@ -1426,7 +1424,17 @@ public void copyToWithPermission(FilePath target) throws IOException, Interrupte
copyTo(target);
// copy file permission
target.chmod(mode());
target.touch(lastModified());
try {
target.touch(lastModified());
} catch (IOException e) {
// On Windows this seems to fail often. See JENKINS-11073
if (!isUnix()) {
LOGGER.warning("Failed to set timestamp on " + target.getRemote());
} else { // rethrow
throw new IOException2(e);
}
}
}
/**

0 comments on commit a7ce870

Please sign in to comment.