@@ -279,24 +279,17 @@ protected InputStream getRequestAsInputStream(String path) throws IOException {
279
279
// use default
280
280
}
281
281
282
- try (CloseableHttpResponse response = executeMethod (host , httpget )) {
283
- int statusCode = response .getStatusLine ().getStatusCode ();
284
- if (statusCode == HttpStatus .SC_NOT_FOUND ) {
285
- EntityUtils .consume (response .getEntity ());
286
- throw new FileNotFoundException ("URL: " + path );
287
- }
288
- if (statusCode != HttpStatus .SC_OK ) {
289
- String content = getResponseContent (response );
290
- throw buildResponseException (response , content );
291
- }
292
- return new ClosingConnectionInputStream (response , httpget , getConnectionManager ());
293
- } catch (BitbucketRequestException | FileNotFoundException e ) {
294
- throw e ;
295
- } catch (IOException e ) {
296
- throw new IOException ("Communication error for url: " + path , e );
297
- } finally {
298
- release (httpget );
282
+ CloseableHttpResponse response = executeMethod (host , httpget );
283
+ int statusCode = response .getStatusLine ().getStatusCode ();
284
+ if (statusCode == HttpStatus .SC_NOT_FOUND ) {
285
+ EntityUtils .consume (response .getEntity ());
286
+ throw new FileNotFoundException ("URL: " + path );
287
+ }
288
+ if (statusCode != HttpStatus .SC_OK ) {
289
+ String content = getResponseContent (response );
290
+ throw buildResponseException (response , content );
299
291
}
292
+ return new ClosingConnectionInputStream (response , httpget , getConnectionManager ());
300
293
}
301
294
302
295
protected int headRequestStatus (String path ) throws IOException {
0 commit comments