We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e825e7b commit 3e4f6abCopy full SHA for 3e4f6ab
src/main/java/org/culturegraph/mf/stream/pipe/FileDigestCalculator.java
@@ -66,10 +66,17 @@ public FileDigestCalculator(final String algorithm) {
66
@Override
67
public void process(final String file) {
68
final String digest;
69
- try (final InputStream stream = new FileInputStream(file)) {
+ InputStream stream = null;
70
+ try {
71
+ stream = new FileInputStream(file);
72
digest = bytesToHex(getDigest(stream, messageDigest));
73
} catch (IOException e) {
74
throw new MetafactureException(e);
75
+ } finally {
76
+ if (stream != null) {
77
+ try { stream.close(); }
78
+ catch (final IOException e) { }
79
+ }
80
}
81
getReceiver().process(new Triple(file, algorithm.name(), digest));
82
0 commit comments