Reduce exception handling scope

pull/36/head
Andrew Gaul 2015-01-16 15:56:08 -08:00
rodzic e1c7b22b7d
commit bae51b500a
1 zmienionych plików z 8 dodań i 6 usunięć

Wyświetl plik

@ -995,14 +995,10 @@ final class S3ProxyHandler extends AbstractHandler {
PutOptions options = new PutOptions()
.multipart(forceMultiPartUpload);
String eTag;
try {
String eTag = blobStore.putBlob(containerName, builder.build(),
eTag = blobStore.putBlob(containerName, builder.build(),
options);
// S3 quotes ETag while Swift does not
if (!eTag.startsWith("\"") && !eTag.endsWith("\"")) {
eTag = '"' + eTag + '"';
}
response.addHeader(HttpHeaders.ETAG, eTag);
} catch (ContainerNotFoundException cnfe) {
sendSimpleErrorResponse(response, S3ErrorCode.NO_SUCH_BUCKET);
return;
@ -1034,6 +1030,12 @@ final class S3ProxyHandler extends AbstractHandler {
throw re;
}
}
// S3 quotes ETag while Swift does not
if (!eTag.startsWith("\"") && !eTag.endsWith("\"")) {
eTag = '"' + eTag + '"';
}
response.addHeader(HttpHeaders.ETAG, eTag);
}
}