Path: blob/master/doc_source/ConfigWebSiteJava.md
4080 views
Managing websites with the AWS SDK for Java
The following example shows how to use the AWS SDK for Java to manage website configuration for a bucket. To add a website configuration to a bucket, you provide a bucket name and a website configuration. The website configuration must include an index document and can include an optional error document. These documents must already exist in the bucket. For more information, see PUT Bucket website. For more information about the Amazon S3 website feature, see Hosting a static website using Amazon S3.
Example The following example uses the AWS SDK for Java to add a website configuration to a bucket, retrieve and print the configuration, and then delete the configuration and verify the deletion. For instructions on how to create and test a working sample, see Testing the Amazon S3 Java Code Examples.