Add comment about AWS S3 "doesBucketExist()" method
This commit is contained in:
parent
c76a279b31
commit
3537610760
|
@ -71,6 +71,12 @@ public class S3BlobStore extends AbstractComponent implements BlobStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.numberOfRetries = maxRetries;
|
this.numberOfRetries = maxRetries;
|
||||||
|
|
||||||
|
// Note: the method client.doesBucketExist() may return 'true' is the bucket exists
|
||||||
|
// but we don't have access to it (ie, 403 Forbidden response code)
|
||||||
|
// Also, if invalid security credentials are used to execute this method, the
|
||||||
|
// client is not able to distinguish between bucket permission errors and
|
||||||
|
// invalid credential errors, and this method could return an incorrect result.
|
||||||
if (!client.doesBucketExist(bucket)) {
|
if (!client.doesBucketExist(bucket)) {
|
||||||
if (region != null) {
|
if (region != null) {
|
||||||
client.createBucket(bucket, region);
|
client.createBucket(bucket, region);
|
||||||
|
|
Loading…
Reference in New Issue