Merge pull request #368 from awhitford/UtilsCleanup

Utils cleanup
This commit is contained in:
Jeremy Long
2015-10-09 06:59:33 -04:00
2 changed files with 1 additions and 8 deletions

View File

@@ -57,7 +57,6 @@ public final class Checksum {
* @throws IOException when the file does not exist
* @throws NoSuchAlgorithmException when an algorithm is specified that does not exist
*/
@SuppressWarnings("empty-statement")
public static byte[] getChecksum(String algorithm, File file) throws NoSuchAlgorithmException, IOException {
MessageDigest digest = MessageDigest.getInstance(algorithm);
FileInputStream fis = null;
@@ -79,12 +78,6 @@ public final class Checksum {
digest.update(byteBuffer);
start += amountToRead;
}
// BufferedInputStream bis = new BufferedInputStream(fis);
// DigestInputStream dis = new DigestInputStream(bis, digest);
// //yes, we are reading in a buffer for performance reasons - 1 byte at a time is SLOW
// byte[] buffer = new byte[8192];
// while (dis.read(buffer) != -1);
} finally {
if (fis != null) {
try {

View File

@@ -61,7 +61,7 @@ public final class FileUtils {
String ret = null;
final int pos = fileName.lastIndexOf(".");
if (pos >= 0) {
ret = fileName.substring(pos + 1, fileName.length()).toLowerCase();
ret = fileName.substring(pos + 1).toLowerCase();
}
return ret;
}