public class BucketWebsiteConfiguration
extends java.lang.Object
implements java.io.Serializable
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.
Constructor and Description |
---|
BucketWebsiteConfiguration()
Creates a new BucketWebsiteConfiguration.
|
BucketWebsiteConfiguration(java.lang.String indexDocumentSuffix)
Creates a new BucketWebsiteConfiguration with the specified index
document suffix.
|
BucketWebsiteConfiguration(java.lang.String indexDocumentSuffix,
java.lang.String errorDocument)
Creates a new BucketWebsiteConfiguration with the specified index
document suffix and error document.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getErrorDocument()
Returns the complete path to the document to serve for 4xx errors, or
null if no error document has been configured.
|
java.lang.String |
getIndexDocumentSuffix()
Returns the document to serve when a directory is specified (ex:
index.html).
|
RedirectRule |
getRedirectAllRequestsTo()
Return the redirect information where all requests will be redirect to.
|
java.util.List<RoutingRule> |
getRoutingRules()
Return the list of routing rules that can be used for configuring
redirects if certain conditions are meet.
|
void |
setErrorDocument(java.lang.String errorDocument)
Sets the complete path to the document to serve for 4xx errors.
|
void |
setIndexDocumentSuffix(java.lang.String indexDocumentSuffix)
Sets the document to serve when a directory is specified (ex:
index.html).
|
void |
setRedirectAllRequestsTo(RedirectRule redirectAllRequestsTo)
Sets the redirect information where all requests will be redirect to.
|
void |
setRoutingRules(java.util.List<RoutingRule> routingRules)
Set the list of routing rules that can be used for configuring redirects
if certain conditions are meet.
|
BucketWebsiteConfiguration |
withRedirectAllRequestsTo(RedirectRule redirectAllRequestsTo)
Sets the redirect information where all requests will be redirect to and
returns a reference to this object(BucketWebsiteConfiguration) for method
chaining.
|
BucketWebsiteConfiguration |
withRoutingRules(java.util.List<RoutingRule> routingRules)
Set the list of routing rules that can be used for configuring redirects
if certain conditions are meet and returns a reference to this
object(BucketWebsiteConfiguration) for method chaining.
|
public BucketWebsiteConfiguration()
public BucketWebsiteConfiguration(java.lang.String indexDocumentSuffix)
indexDocumentSuffix
- The document to serve when a directory is
specified (ex: index.html). This path is relative to the
requested resource.public BucketWebsiteConfiguration(java.lang.String indexDocumentSuffix, java.lang.String errorDocument)
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.public java.lang.String getIndexDocumentSuffix()
public void setIndexDocumentSuffix(java.lang.String indexDocumentSuffix)
indexDocumentSuffix
- The document to serve when a directory is
specified (ex: index.html). This path is relative to the
requested resource.public java.lang.String getErrorDocument()
public void setErrorDocument(java.lang.String errorDocument)
errorDocument
- The complete path to the document to serve for 4xx
errors.public void setRedirectAllRequestsTo(RedirectRule redirectAllRequestsTo)
redirectAllRequestsTo
- The Redirect information where all requests
will be redirect to.public RedirectRule getRedirectAllRequestsTo()
public BucketWebsiteConfiguration withRedirectAllRequestsTo(RedirectRule redirectAllRequestsTo)
redirectAllRequestsTo
- The Redirect information where all requests
will be redirect to.public void setRoutingRules(java.util.List<RoutingRule> routingRules)
routingRules
- The list of routing rules that can be used for
configuring redirects.public java.util.List<RoutingRule> getRoutingRules()
public BucketWebsiteConfiguration withRoutingRules(java.util.List<RoutingRule> routingRules)
routingRules
- The list of routing rules that can be used for
configuring redirects.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.