use of com.talend.shaded.com.amazonaws.services.s3.model.Bucket in project camel by apache.
the class S3Producer method listBuckets.
private void listBuckets(AmazonS3 s3Client, Exchange exchange) {
List<Bucket> bucketsList = s3Client.listBuckets();
Message message = getMessageForResponse(exchange);
message.setBody(bucketsList);
}
use of com.talend.shaded.com.amazonaws.services.s3.model.Bucket in project camel by apache.
the class AmazonS3ClientMock method createBucket.
@Override
public Bucket createBucket(CreateBucketRequest createBucketRequest) throws AmazonClientException, AmazonServiceException {
if ("nonExistingBucket".equals(createBucketRequest.getBucketName())) {
nonExistingBucketCreated = true;
}
Bucket bucket = new Bucket();
bucket.setName(createBucketRequest.getBucketName());
bucket.setCreationDate(new Date());
bucket.setOwner(new Owner("c2efc7302b9011ba9a78a92ac5fd1cd47b61790499ab5ddf5a37c31f0638a8fc ", "Christian Mueller"));
return bucket;
}
use of com.talend.shaded.com.amazonaws.services.s3.model.Bucket in project aws-doc-sdk-examples by awsdocs.
the class CreateBucket method createBucket.
public static Bucket createBucket(String bucket_name) {
final AmazonS3 s3 = AmazonS3ClientBuilder.defaultClient();
Bucket b = null;
if (s3.doesBucketExist(bucket_name)) {
System.out.format("Bucket %s already exists.\n", bucket_name);
b = getBucket(bucket_name);
} else {
try {
b = s3.createBucket(bucket_name);
} catch (AmazonS3Exception e) {
System.err.println(e.getErrorMessage());
}
}
return b;
}
use of com.talend.shaded.com.amazonaws.services.s3.model.Bucket in project Synapse-Stack-Builder by Sage-Bionetworks.
the class StackConfigurationSetup method setupMainFileBucket.
/**
* Sets up the main S3 bucket (if not already exist) for storing app data.
*/
public void setupMainFileBucket() {
String bucketName = config.getMainFileS3BucketName();
Bucket bucket = client.createBucket(bucketName);
resources.setMainFileS3Bucket(bucket);
}
use of com.talend.shaded.com.amazonaws.services.s3.model.Bucket in project Synapse-Stack-Builder by Sage-Bionetworks.
the class StackConfigurationSetup method setupAndUploadStackConfig.
/**
* Builds and uploads the Stack configuration file used by the beanstalk instances.
* @throws IOException
*/
public void setupAndUploadStackConfig() throws IOException {
// Fist make sure the bucket exists
String bucketName = config.getStackConfigS3BucketName();
log.info("Creating S3 Bucket: " + bucketName);
// This call is idempotent and will only actually create the bucket if it does not already exist.
Bucket bucket = client.createBucket(bucketName);
// This is the final property file that will be uploaded to S3.
Properties props = createConfigProperties();
// Write to a temp file that will get deleted.
File temp = File.createTempFile("TempProps", ".properties");
saveUploadDelete(bucketName, props, temp);
}
Aggregations