Skip to content

Commit 7a00e93

Browse files
add try-catch to ensure release of http resource
1 parent a62337f commit 7a00e93

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

addons-client/folo/client-java/src/main/java/org/commonjava/indy/folo/client/IndyFoloAdminClientModule.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,16 @@ public TrackingIdsDTO getTrackingIds( final String trackingType )
115115
public void deleteFilesFromStoreByTrackingID( final BatchDeleteRequest request )
116116
throws IndyClientException
117117
{
118-
http.postRaw( UrlUtils.buildUrl( "/folo/admin/batch/delete" ), request );
118+
final String url = UrlUtils.buildUrl("/folo/admin/batch/delete");
119+
try ( HttpResources resources = http.postRaw( url, request ) )
120+
{
121+
// Do something with the response?
122+
}
123+
catch (final IndyClientException e)
124+
{
125+
throw new IndyClientException( resources.getStatusCode(), "Error deleting files: %s",
126+
new IndyResponseErrorDetails( resources.getResponse() ) );
127+
}
119128
}
120129

121130
@Deprecated

0 commit comments

Comments
 (0)