Skip to content

Commit 4a12c2e

Browse files
committed
use try with resources
Signed-off-by: Sooraj Sinha <[email protected]>
1 parent 8f3c702 commit 4a12c2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/org/opensearch/gateway/remote/model/RemoteClusterStateBlobStore.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ public void writeAsync(final U entity, final ActionListener<Void> listener) {
7272
public T read(final U entity) throws IOException {
7373
// TODO Add timing logs and tracing
7474
assert entity.getFullBlobName() != null;
75-
return entity.deserialize(transferService.downloadBlob(getBlobPathForDownload(entity), entity.getBlobFileName()));
75+
try (InputStream inputStream = transferService.downloadBlob(getBlobPathForDownload(entity), entity.getBlobFileName())) {
76+
return entity.deserialize(inputStream);
77+
}
7678
}
7779

7880
@Override

0 commit comments

Comments
 (0)