Merge pull request #1100 from andrewgaul/close-payload

Close Payload directly
This commit is contained in:
Adrian Cole 2012-12-27 18:26:05 -08:00
commit ba156b7552
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);
}
}