mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-09 18:16:10 +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
@@ -588,6 +588,22 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the MD5 digest of a file.
|
||||
* @param file a file
|
||||
* @return a 32-character string
|
||||
* @throws IOException in case reading fails
|
||||
* @since 1.525
|
||||
*/
|
||||
public static String getDigestOf(File file) throws IOException {
|
||||
InputStream is = new FileInputStream(file);
|
||||
try {
|
||||
return getDigestOf(new BufferedInputStream(is));
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string into 128-bit AES key.
|
||||
* @since 1.308
|
||||
|
||||
Reference in new issue
Block a user