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;
}
} finally {
if (response.getPayload() != null)
Closeables.closeQuietly(response.getPayload().getInput());
Closeables.closeQuietly(response.getPayload());
command.setException(exception);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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