fix(S3): use doesBucketExist() to evaluate bucket existance
This commit is contained in:
parent
2f1f9faeae
commit
c55dc62d16
@ -110,16 +110,9 @@ class S3Impl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean bucketExists() throws BackendException {
|
public boolean bucketExists() throws BackendException {
|
||||||
try {
|
if (client().doesBucketExist(cloud.s3Bucket())) {
|
||||||
client().listObjectsV2(cloud.s3Bucket());
|
|
||||||
} catch(AmazonS3Exception ex) {
|
|
||||||
if (ex.getErrorCode().equals(S3CloudApiExceptions.S3CloudApiErrorCodes.NO_SUCH_BUCKET.getValue())) {
|
|
||||||
throw new NoSuchBucketException(cloud.s3Bucket());
|
throw new NoSuchBucketException(cloud.s3Bucket());
|
||||||
} else {
|
|
||||||
throw new FatalBackendException(ex);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user