use of com.obs.services.model.CreateBucketRequest in project jeesuite-libs by vakinge.
the class HuaweicloudProvider method createBucket.
@Override
public void createBucket(String bucketName, boolean isPrivate) {
if (existsBucket(bucketName)) {
throw new RuntimeException("bucket[" + bucketName + "] 已经存在");
}
CreateBucketRequest request = new CreateBucketRequest(bucketName, conf.getRegionName());
ObsBucket bucket = new ObsBucket();
bucket.setBucketName(bucketName);
AccessControlList acl = null;
if (isPrivate) {
acl = AccessControlList.REST_CANNED_PRIVATE;
} else {
acl = AccessControlList.REST_CANNED_PUBLIC_READ;
}
request.setAcl(acl);
obsClient.createBucket(request);
}
Aggregations