Skip to content
Permalink
Browse files

[FIXED JENKINS-13515] FingerprintingCopyMethod.copyOne can fail on Wi…

…ndows due to timestamp.
  • Loading branch information
jglick committed Sep 21, 2012
1 parent c587a69 commit d86690cc2659fd2efa992391e4c216d7635db8e3
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/main/java/hudson/plugins/copyartifact/FingerprintingCopyMethod.java
@@ -2,6 +2,7 @@

import hudson.Extension;
import hudson.FilePath;
import hudson.Functions;
import hudson.Util;
import hudson.model.AbstractBuild;
import hudson.model.Fingerprint;
@@ -17,6 +18,7 @@
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

/**
* Performs fingerprinting during the copy.
@@ -76,7 +78,16 @@ public void copyOne(FilePath s, FilePath d) throws IOException, InterruptedExcep
out.close();
}
d.chmod(s.mode());
d.touch(s.lastModified());
// FilePath.setLastModifiedIfPossible private; copyToWithPermission OK but would have to calc digest separately:
try {
d.touch(s.lastModified());
} catch (IOException x) {
if (Functions.isWindows()) {
Logger.getLogger(FingerprintingCopyMethod.class.getName()).warning(x.getMessage());
} else {
throw x;
}
}
String digest = Util.toHexString(md5.digest());

FingerprintMap map = Jenkins.getInstance().getFingerprintMap();

0 comments on commit d86690c

Please sign in to comment.
You can’t perform that action at this time.