Skip to content

Commit

Permalink
use try with resources
Browse files Browse the repository at this point in the history
Signed-off-by: Sooraj Sinha <[email protected]>
  • Loading branch information
soosinha committed Jun 14, 2024
1 parent 8f3c702 commit 3a342c6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public void writeAsync(final U entity, final ActionListener<Void> listener) {
public T read(final U entity) throws IOException {
// TODO Add timing logs and tracing
assert entity.getFullBlobName() != null;
return entity.deserialize(transferService.downloadBlob(getBlobPathForDownload(entity), entity.getBlobFileName()));
try (InputStream inputStream = transferService.downloadBlob(getBlobPathForDownload(entity), entity.getBlobFileName())) {
return entity.deserialize(inputStream);
}
}

@Override
Expand Down

0 comments on commit 3a342c6

Please sign in to comment.