* @throws IllegalStateException
* The bucket is not created before timeout occurs
*/
public static void createBucket(AmazonS3Client client, String bucketName) {
if (!bucketExists(client, bucketName)) {
CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName);
createBucketRequest.setRegion(Region.US_Standard.toString());
client.createBucket(createBucketRequest);
}
long startTime = System.currentTimeMillis();
long endTime = startTime + 60 * 1000;
while (!bucketExists(client, bucketName) && endTime > System.currentTimeMillis()) {