assertParameterNotNull(createBucketRequest,
"The CreateBucketRequest parameter must be specified when creating a bucket");
String bucketName = createBucketRequest.getBucketName();
String region = createBucketRequest.getRegion();
CannedAccessControlList acl = createBucketRequest.getCannedAcl();
assertParameterNotNull(bucketName,
"The bucket name parameter must be specified when creating a bucket");
if (bucketName != null) bucketName = bucketName.trim();
bucketNameUtils.validateBucketName(bucketName);
Request<CreateBucketRequest> request = createRequest(bucketName, null, createBucketRequest, HttpMethodName.PUT);
if (acl != null) request.addHeader(Headers.S3_CANNED_ACL, acl.toString());
/*
* We can only send the CreateBucketConfiguration if we're *not*
* creating a bucket in the US region.
*/