[[JENKINS-16301] Use a buffered input stream to get somewhat better performance also from Maven archiving.

Introducing Util.getDigestOf(File) as a convenience.
This commit is contained in:
Jesse Glick committed 2013-07-24 16:30:48 -04:00
1 parent e0a3a1ddf5
commit 11953750ab
5 files changed
+21 -12

No files matched your search

+2 -6
View File
@@ -1681,17 +1681,13 @@ public final class FilePath implements Serializable {
/**
* Computes the MD5 digest of the file in hex string.
* @see Util#getDigestOf(File)
*/
public String digest() throws IOException, InterruptedException {
return act(new FileCallable<String>() {
private static final long serialVersionUID = 1L;
public String invoke(File f, VirtualChannel channel) throws IOException {
FileInputStream is = new FileInputStream(f);
try {
return Util.getDigestOf(new BufferedInputStream(is));
} finally {
is.close();
}
return Util.getDigestOf(f);
}
});
}