Package com.amazonaws.services.s3.model
Class CORSRule
- java.lang.Object
-
- com.amazonaws.services.s3.model.CORSRule
-
- All Implemented Interfaces:
Serializable
public class CORSRule extends Object implements Serializable
Container for rules of cross origin configuration.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CORSRule.AllowedMethods
Enumeration of names of the all the allowed methods.
-
Constructor Summary
Constructors Constructor Description CORSRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getAllowedHeaders()
Returns allowed headers of this rule.List<CORSRule.AllowedMethods>
getAllowedMethods()
Returns the allowed methods of this rule.List<String>
getAllowedOrigins()
Returns the allowed origins of this rule and returns a reference to this object for method chaining.List<String>
getExposedHeaders()
Returns expose headers of this rule and returns a reference to this object for method chaining.String
getId()
Returns the Id of this rule.int
getMaxAgeSeconds()
Sets the ID of this rule and returns a reference to this object for method chaining.void
setAllowedHeaders(String... allowedHeaders)
Convenience array style method forsetAllowedHeaders(List)
void
setAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers for the rule.void
setAllowedMethods(CORSRule.AllowedMethods... allowedMethods)
Convenience array style method forsetAllowedMethods(List)
void
setAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
Sets the allowed methods of the rule.void
setAllowedOrigins(String... allowedOrigins)
Convenience array style method forsetAllowedOrigins(List)
void
setAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins of the rule.void
setExposedHeaders(String... exposedHeaders)
Convenience array style method forsetExposedHeaders(List)
void
setExposedHeaders(List<String> exposedHeaders)
Sets the expose headers of the rule.void
setId(String id)
Sets the ID of this rule.void
setMaxAgeSeconds(int maxAgeSeconds)
Sets the max age in seconds of the rule.CORSRule
withAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers of this rule and returns a reference to this object for method chaining.CORSRule
withAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
Sets the allowed methods of this rule and returns a reference to this object for method chaining.CORSRule
withAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins of this rule and returns a reference to this object for method chaining.CORSRule
withExposedHeaders(List<String> exposedHeaders)
Sets the exposeHeaders of this rule and returns a reference to this object for method chaining.CORSRule
withId(String id)
Sets the ID of this rule and returns a reference to this object for method chaining.CORSRule
withMaxAgeSeconds(int maxAgeSeconds)
Sets the max age in seconds of this rule and returns a reference to this object for method chaining.
-
-
-
Method Detail
-
setId
public void setId(String id)
Sets the ID of this rule. Rules must be less than 255 alphanumeric characters, and must be unique for a bucket. If you do not assign an ID, one will be generated.
-
getId
public String getId()
Returns the Id of this rule.
-
withId
public CORSRule withId(String id)
Sets the ID of this rule and returns a reference to this object for method chaining.- See Also:
setId(String)
-
setAllowedMethods
public void setAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
Sets the allowed methods of the rule.
-
setAllowedMethods
public void setAllowedMethods(CORSRule.AllowedMethods... allowedMethods)
Convenience array style method forsetAllowedMethods(List)
-
getAllowedMethods
public List<CORSRule.AllowedMethods> getAllowedMethods()
Returns the allowed methods of this rule.
-
withAllowedMethods
public CORSRule withAllowedMethods(List<CORSRule.AllowedMethods> allowedMethods)
Sets the allowed methods of this rule and returns a reference to this object for method chaining.- See Also:
setAllowedMethods(List)
-
setAllowedOrigins
public void setAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins of the rule.
-
setAllowedOrigins
public void setAllowedOrigins(String... allowedOrigins)
Convenience array style method forsetAllowedOrigins(List)
-
getAllowedOrigins
public List<String> getAllowedOrigins()
Returns the allowed origins of this rule and returns a reference to this object for method chaining.
-
withAllowedOrigins
public CORSRule withAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins of this rule and returns a reference to this object for method chaining.- See Also:
setAllowedOrigins(List)
-
setMaxAgeSeconds
public void setMaxAgeSeconds(int maxAgeSeconds)
Sets the max age in seconds of the rule.
-
getMaxAgeSeconds
public int getMaxAgeSeconds()
Sets the ID of this rule and returns a reference to this object for method chaining.- See Also:
setId(String)
-
withMaxAgeSeconds
public CORSRule withMaxAgeSeconds(int maxAgeSeconds)
Sets the max age in seconds of this rule and returns a reference to this object for method chaining.- See Also:
setMaxAgeSeconds(int)
-
setExposedHeaders
public void setExposedHeaders(List<String> exposedHeaders)
Sets the expose headers of the rule.
-
setExposedHeaders
public void setExposedHeaders(String... exposedHeaders)
Convenience array style method forsetExposedHeaders(List)
-
getExposedHeaders
public List<String> getExposedHeaders()
Returns expose headers of this rule and returns a reference to this object for method chaining.
-
withExposedHeaders
public CORSRule withExposedHeaders(List<String> exposedHeaders)
Sets the exposeHeaders of this rule and returns a reference to this object for method chaining.- See Also:
setExposedHeaders(List)
-
setAllowedHeaders
public void setAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers for the rule.
-
setAllowedHeaders
public void setAllowedHeaders(String... allowedHeaders)
Convenience array style method forsetAllowedHeaders(List)
-
withAllowedHeaders
public CORSRule withAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers of this rule and returns a reference to this object for method chaining.- See Also:
setAllowedHeaders(List)
-
-