use of software.amazon.awssdk.services.s3.model.HeadBucketRequest in project wildfly-camel by wildfly-extras.
the class S3Utils method createBucket.
@SuppressWarnings("unchecked")
public static void createBucket(AmazonS3Client client, String bucketName) throws Exception {
client.createBucket(bucketName);
HeadBucketRequest request = new HeadBucketRequest(bucketName);
Waiter<HeadBucketRequest> waiter = client.waiters().bucketExists();
Future<Void> future = waiter.runAsync(new WaiterParameters<HeadBucketRequest>(request), new NoOpWaiterHandler());
future.get(1, TimeUnit.MINUTES);
}
use of software.amazon.awssdk.services.s3.model.HeadBucketRequest in project flink by apache.
the class AWSServicesTestUtils method createBucket.
public static void createBucket(S3AsyncClient s3Client, String bucketName) throws ExecutionException, InterruptedException {
CreateBucketRequest bucketRequest = CreateBucketRequest.builder().bucket(bucketName).build();
s3Client.createBucket(bucketRequest);
HeadBucketRequest bucketRequestWait = HeadBucketRequest.builder().bucket(bucketName).build();
try (final S3AsyncWaiter waiter = s3Client.waiter()) {
waiter.waitUntilBucketExists(bucketRequestWait).get();
}
}
Aggregations