Skip to content
Snippets Groups Projects
Commit 9aa5180c authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- try-with-resources closes 'is', but 'is' is stored internally in BufferInputStream to read from

parent 4feafc9d
No related branches found
No related tags found
1 merge request!2Bugfix: try-with-resources closes 'is', but 'is' is stored internally in BufferInputStream to read from
Pipeline #6377 passed
......@@ -83,7 +83,7 @@
</fr:x_form>
</pl:initParameters>
<pl:description>SLUB Storage Plugin</pl:description>
<pl:version>2.97</pl:version>
<pl:version>2.98</pl:version>
<pl:materialType>DIGITAL</pl:materialType>
<pl:module>Repository</pl:module>
<pl:generalType>TASK</pl:generalType>
......
......@@ -479,8 +479,9 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
contractAssertIsRelativePath(storedEntityIdentifier);
var absolute_filename = getFullFilePath(storedEntityIdentifier);
var absolute_path = Paths.get(absolute_filename);
try (InputStream is = Files.newInputStream(absolute_path)) {
return new BufferedInputStream(is, getBlockSize());
try { /* do not use try-with-resources, because is is closed */
InputStream is = Files.newInputStream(absolute_path);
return new BufferedInputStream(is, getBlockSize());
} catch (IOException e) {
log.error("SLUBStoragePlugin.retrieveEntity() with storedEntityIdentifier '" + storedEntityIdentifier
+ "', I/O error, file=" + absolute_filename + " " + e.getMessage());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment