com.amazonaws.services.s3.model
Class BucketWebsiteConfiguration

java.lang.Object
  extended by com.amazonaws.services.s3.model.BucketWebsiteConfiguration

public class BucketWebsiteConfiguration
extends Object

Bucket configuration options for hosting static websites entirely out of Amazon S3.

To host a static website in Amazon S3, create a bucket, upload your files, and set the bucket website configuration. Once your bucket has been configured as a website, you can access all your content via the Amazon S3 website endpoint. To ensure that the existing Amazon S3 REST API will continue to behave the same, regardless of whether or not your bucket has been configured to host a website, a new HTTP endpoint has been introduced where you can access your website content. The bucket content you want to make available via the website must be publicly readable.

To enable hosting websites, Amazon S3 introduces the following concepts/features:

For more information on how to host a website on Amazon S3, see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting.html.

See Also:
AmazonS3#setBucketWebsiteConfiguration(String, BucketWebsiteConfiguration), AmazonS3#getBucketWebsiteConfiguration(String), AmazonS3#deleteBucketWebsiteConfiguration(String)

Constructor Summary
BucketWebsiteConfiguration(String indexDocumentSuffix)
          Creates a new BucketWebsiteConfiguration with the specified index document suffix.
BucketWebsiteConfiguration(String indexDocumentSuffix, String errorDocument)
          Creates a new BucketWebsiteConfiguration with the specified index document suffix and error document.
 
Method Summary
 String getErrorDocument()
          Returns the complete path to the document to serve for 4xx errors, or null if no error document has been configured.
 String getIndexDocumentSuffix()
          Returns the document to serve when a directory is specified (ex: index.html).
 void setErrorDocument(String errorDocument)
          Sets the complete path to the document to serve for 4xx errors.
 void setIndexDocumentSuffix(String indexDocumentSuffix)
          Sets the document to serve when a directory is specified (ex: index.html).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BucketWebsiteConfiguration

public BucketWebsiteConfiguration(String indexDocumentSuffix)
Creates a new BucketWebsiteConfiguration with the specified index document suffix.

Parameters:
indexDocumentSuffix - The document to serve when a directory is specified (ex: index.html). This path is relative to the requested resource.

BucketWebsiteConfiguration

public BucketWebsiteConfiguration(String indexDocumentSuffix,
                                  String errorDocument)
Creates a new BucketWebsiteConfiguration with the specified index document suffix and error document.

Parameters:
indexDocumentSuffix - The document to serve when a directory is specified (ex: index.html). This path is relative to the requested resource.
errorDocument - The complete path to the document to serve for 4xx errors.
Method Detail

getIndexDocumentSuffix

public String getIndexDocumentSuffix()
Returns the document to serve when a directory is specified (ex: index.html). This path is relative to the requested resource.

Returns:
The document to serve when a directory is specified (ex: index.html). This path is relative to the requested resource.

setIndexDocumentSuffix

public void setIndexDocumentSuffix(String indexDocumentSuffix)
Sets the document to serve when a directory is specified (ex: index.html). This path is relative to the requested resource.

Parameters:
indexDocumentSuffix - The document to serve when a directory is specified (ex: index.html). This path is relative to the requested resource.

getErrorDocument

public String getErrorDocument()
Returns the complete path to the document to serve for 4xx errors, or null if no error document has been configured.

Returns:
The complete path to the document to serve for 4xx errors, or null if no error document has been configured.

setErrorDocument

public void setErrorDocument(String errorDocument)
Sets the complete path to the document to serve for 4xx errors.

Parameters:
errorDocument - The complete path to the document to serve for 4xx errors.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.