[DURACOM-109] Fixed http connection leaks

This commit is contained in:
Elios Buzo
2025-04-18 15:00:38 +02:00
parent 9e379714e8
commit cc69c5b70e
9 changed files with 73 additions and 108 deletions

View File

@@ -38,8 +38,7 @@ public class IIIFApiQueryServiceImpl implements IIIFApiQueryService {
int[] arr = new int[2];
String path = IIIFSharedUtils.getInfoJsonPath(bitstream);
BufferedReader in = null;
try {
CloseableHttpClient httpClient = DSpaceHttpClientFactory.getInstance().build();
try (CloseableHttpClient httpClient = DSpaceHttpClientFactory.getInstance().build()) {
CloseableHttpResponse httpResponse = httpClient.execute(new HttpGet(path));
in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
String inputLine;