mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-05 16:15:54 +00:00
[[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:
1 parent
e0a3a1ddf5
commit
11953750ab
5 files changed
+21
-12
No files matched your search
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user