List of usage examples for com.amazonaws.services.s3.model BucketWebsiteConfiguration BucketWebsiteConfiguration
public BucketWebsiteConfiguration(String indexDocumentSuffix, String errorDocument)
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"); } }