Example usage for com.amazonaws.services.s3.model BucketWebsiteConfiguration BucketWebsiteConfiguration

List of usage examples for com.amazonaws.services.s3.model BucketWebsiteConfiguration BucketWebsiteConfiguration

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model BucketWebsiteConfiguration BucketWebsiteConfiguration.

Prototype

public BucketWebsiteConfiguration(String indexDocumentSuffix, String errorDocument) 

Source Link

Document

Creates a new BucketWebsiteConfiguration with the specified index document suffix and error document.

Usage

From source file:cloudExplorer.Acl.java

License:Open Source License

void setBUCKETwebsite(String object, String access_key, String secret_key, String endpoint, String bucket) {
    try {//from w  w  w  .  j  a v a2  s .com
        AWSCredentials credentials = new BasicAWSCredentials(access_key, secret_key);
        AmazonS3 s3Client = new AmazonS3Client(credentials,
                new ClientConfiguration().withSignerOverride("S3SignerType"));
        s3Client.setEndpoint(endpoint);
        BucketWebsiteConfiguration bucketWebsiteConfiguration = s3Client.getBucketWebsiteConfiguration(bucket);
        s3Client.setBucketAcl(bucket, CannedAccessControlList.PublicRead);
        s3Client.setBucketWebsiteConfiguration(bucket,
                new BucketWebsiteConfiguration("index.html", "error.html"));
    } catch (Exception setACLpublic) {
        mainFrame.jTextArea1.append("\nException occurred in ACL");
    }
}