Close Payload directly

This commit is contained in:
Andrew Gaul 2012-12-27 17:35:25 -08:00
parent 0880245150
commit 614e262ce0
9 changed files with 9 additions and 19 deletions

View File

@ -84,8 +84,7 @@ public class CloudSigmaErrorHandler implements HttpErrorHandler {
break; break;
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -82,8 +82,7 @@ public class CloudStackErrorHandler implements HttpErrorHandler {
break; break;
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -77,8 +77,7 @@ public class DeltacloudErrorHandler implements HttpErrorHandler {
} }
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -82,8 +82,7 @@ public class ElasticStackErrorHandler implements HttpErrorHandler {
break; break;
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -83,9 +83,7 @@ public class AbiquoErrorHandler implements HttpErrorHandler {
break; break;
} }
} finally { } finally {
if (response.getPayload() != null) { Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
}
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -74,8 +74,7 @@ public class VPDCErrorHandler implements HttpErrorHandler {
break; break;
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -74,8 +74,7 @@ public class GleSYSErrorHandler implements HttpErrorHandler {
break; break;
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -70,8 +70,7 @@ public class SoftLayerErrorHandler implements HttpErrorHandler {
} }
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -66,8 +66,7 @@ public class BoxDotNetErrorHandler implements HttpErrorHandler {
break; break;
} }
} finally { } finally {
if (response.getPayload() != null) Closeables.closeQuietly(response.getPayload());
Closeables.closeQuietly(response.getPayload().getInput());
command.setException(exception); command.setException(exception);
} }
} }