Example usage for com.amazonaws.services.s3 AmazonS3Client waiters

List of usage examples for com.amazonaws.services.s3 AmazonS3Client waiters

Introduction

In this page you can find the example usage for com.amazonaws.services.s3 AmazonS3Client waiters.

Prototype

AmazonS3Waiters waiters

To view the source code for com.amazonaws.services.s3 AmazonS3Client waiters.

Click Source Link

Usage

From source file:org.wildfly.camel.test.common.aws.S3Utils.java

License:Apache License

@SuppressWarnings("unchecked")
public static void createBucket(AmazonS3Client client, String bucketName) throws Exception {

    client.createBucket(bucketName);/*from w ww.  j a va 2s  .  c om*/

    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);
}