diff --git a/src/main/java/uk/ac/ebi/pride/gui/util/Hash.java b/src/main/java/uk/ac/ebi/pride/gui/util/Hash.java index 0acf1ac6..14e7daea 100644 --- a/src/main/java/uk/ac/ebi/pride/gui/util/Hash.java +++ b/src/main/java/uk/ac/ebi/pride/gui/util/Hash.java @@ -13,7 +13,12 @@ public class Hash { private final static Logger LOGGER = LoggerFactory.getLogger(Hash.class); public static String getSha1Checksum(File file) throws IOException { - return DigestUtils.sha1Hex(new FileInputStream(file)); + + FileInputStream fileInputStream = new FileInputStream(file); + String checksum = DigestUtils.sha1Hex(fileInputStream); + fileInputStream.close(); + + return checksum; } public static String getSha256Checksum(String str) {