Class CfnBucket.RedirectRuleProperty.Builder
java.lang.Object
software.amazon.awscdk.services.s3.CfnBucket.RedirectRuleProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnBucket.RedirectRuleProperty>
- Enclosing interface:
- CfnBucket.RedirectRuleProperty
@Stability(Stable)
public static final class CfnBucket.RedirectRuleProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnBucket.RedirectRuleProperty>
A builder for
CfnBucket.RedirectRuleProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofCfnBucket.RedirectRuleProperty.getHostName()
httpRedirectCode
(String httpRedirectCode) Sets the value ofCfnBucket.RedirectRuleProperty.getHttpRedirectCode()
Sets the value ofCfnBucket.RedirectRuleProperty.getProtocol()
replaceKeyPrefixWith
(String replaceKeyPrefixWith) Sets the value ofCfnBucket.RedirectRuleProperty.getReplaceKeyPrefixWith()
replaceKeyWith
(String replaceKeyWith) Sets the value ofCfnBucket.RedirectRuleProperty.getReplaceKeyWith()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
hostName
Sets the value ofCfnBucket.RedirectRuleProperty.getHostName()
- Parameters:
hostName
- The host name to use in the redirect request.- Returns:
this
-
httpRedirectCode
@Stability(Stable) public CfnBucket.RedirectRuleProperty.Builder httpRedirectCode(String httpRedirectCode) Sets the value ofCfnBucket.RedirectRuleProperty.getHttpRedirectCode()
- Parameters:
httpRedirectCode
- The HTTP redirect code to use on the response. Not required if one of the siblings is present.- Returns:
this
-
protocol
Sets the value ofCfnBucket.RedirectRuleProperty.getProtocol()
- Parameters:
protocol
- Protocol to use when redirecting requests. The default is the protocol that is used in the original request.- Returns:
this
-
replaceKeyPrefixWith
@Stability(Stable) public CfnBucket.RedirectRuleProperty.Builder replaceKeyPrefixWith(String replaceKeyPrefixWith) Sets the value ofCfnBucket.RedirectRuleProperty.getReplaceKeyPrefixWith()
- Parameters:
replaceKeyPrefixWith
- The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefixdocs/
(objects in thedocs/
folder) todocuments/
, you can set a condition block withKeyPrefixEquals
set todocs/
and in the Redirect setReplaceKeyPrefixWith
to/documents
. Not required if one of the siblings is present. Can be present only ifReplaceKeyWith
is not provided.Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
- Returns:
this
-
replaceKeyWith
@Stability(Stable) public CfnBucket.RedirectRuleProperty.Builder replaceKeyWith(String replaceKeyWith) Sets the value ofCfnBucket.RedirectRuleProperty.getReplaceKeyWith()
- Parameters:
replaceKeyWith
- The specific object key to use in the redirect request. For example, redirect request toerror.html
. Not required if one of the siblings is present. Can be present only ifReplaceKeyPrefixWith
is not provided.Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnBucket.RedirectRuleProperty>
- Returns:
- a new instance of
CfnBucket.RedirectRuleProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-