com.baidubce.services.bos.model
Class CorsConfiguration

java.lang.Object
  extended by com.baidubce.services.bos.model.CorsConfiguration

public class CorsConfiguration
extends Object

CorsConfiguration for Bucket CORS(Cross-Origin Resource Sharing). Bucket's CORS rule container. Allow up to 100 rules. If there are multiple configurations, the order of execution is from top to bottom. Required Parameters: allowedOrigins. Required Parameters: allowedMethods. Optional Parameters: allowedHeaders. Optional Parameters: allowedExposeHeaders. Optional Parameters: maxAgeSeconds.


Constructor Summary
CorsConfiguration()
          The void Constructor of Bucket CORS.
CorsConfiguration(List<String> allowedOrigins, List<AllowedMethods> allowedMethods, List<String> allowedHeaders, List<String> allowedExposeHeaders, int maxAgeSeconds)
          The Constructor of Bucket CORS.
 
Method Summary
 List<String> getAllowedExposeHeaders()
          Gets allowedExposeHeaders of Bucket CORS.
 List<String> getAllowedHeaders()
          Gets allowedHeaders of Bucket CORS.
 List<AllowedMethods> getAllowedMethods()
          Gets allowedMethods of Bucket CORS.
 List<String> getAllowedOrigins()
          Gets allowedOrigins of Bucket CORS.
 int getMaxAgeSeconds()
          Gets maxAgeSeconds of Bucket CORS.
 void setAllowedExposeHeaders(List<String> allowedExposeHeaders)
          Sets allowedExposeHeaders of Bucket CORS.
 void setAllowedHeaders(List<String> allowedHeaders)
          Sets allowedHeaders of Bucket CORS.
 void setAllowedMethods(List<AllowedMethods> allowedMethods)
          Sets allowedMethods of Bucket CORS.
 void setAllowedOrigins(List<String> allowedOrigins)
          Sets allowedOrigins of Bucket CORS.
 void setMaxAgeSeconds(int maxAgeSeconds)
          Sets maxAgeSeconds of Bucket CORS.
 String toString()
           
 CorsConfiguration withAllowedExposeHeaders(List<String> allowedExposeHeaders)
          Sets allowedExposeHeaders of Bucket CORS.
 CorsConfiguration withAllowedHeaders(List<String> allowedHeaders)
          Sets allowedHeaders of Bucket CORS.
 CorsConfiguration withAllowedMethods(List<AllowedMethods> allowedMethods)
          Sets allowedMethods of Bucket CORS.
 CorsConfiguration withAllowedOrigins(List<String> allowedOrigins)
          Sets allowedOrigins of Bucket CORS.
 CorsConfiguration withMaxAgeSeconds(int maxAgeSeconds)
          Sets maxAgeSeconds of Bucket CORS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CorsConfiguration

public CorsConfiguration()
The void Constructor of Bucket CORS.


CorsConfiguration

public CorsConfiguration(List<String> allowedOrigins,
                         List<AllowedMethods> allowedMethods,
                         List<String> allowedHeaders,
                         List<String> allowedExposeHeaders,
                         int maxAgeSeconds)
The Constructor of Bucket CORS.

Parameters:
allowedOrigins - The allowedOrigins of Bucket CROS.
allowedMethods - The allowedMethods of Bucket CROS.
allowedHeaders - The allowedHeaders of Bucket CROS.
allowedExposeHeaders - The allowedExposeHeaders of Bucket CROS.
maxAgeSeconds - The maxAgeSeconds of Bucket CROS.
Method Detail

getAllowedOrigins

public List<String> getAllowedOrigins()
Gets allowedOrigins of Bucket CORS.

Returns:
allowedOrigins of Bucket CORS.

setAllowedOrigins

public void setAllowedOrigins(List<String> allowedOrigins)
Sets allowedOrigins of Bucket CORS.

Parameters:
allowedOrigins - The allowedOrigins of Bucket CORS.

withAllowedOrigins

public CorsConfiguration withAllowedOrigins(List<String> allowedOrigins)
Sets allowedOrigins of Bucket CORS.

Parameters:
allowedOrigins - The allowedOrigins of Bucket CORS.
Returns:
this object.

getAllowedMethods

public List<AllowedMethods> getAllowedMethods()
Gets allowedMethods of Bucket CORS.

Returns:
allowedMethods of Bucket CORS.

setAllowedMethods

public void setAllowedMethods(List<AllowedMethods> allowedMethods)
Sets allowedMethods of Bucket CORS.

Parameters:
allowedMethods - The allowedMethods of Bucket CORS.

withAllowedMethods

public CorsConfiguration withAllowedMethods(List<AllowedMethods> allowedMethods)
Sets allowedMethods of Bucket CORS.

Parameters:
allowedMethods - The allowedMethods of Bucket CORS.
Returns:
this object.

getAllowedHeaders

public List<String> getAllowedHeaders()
Gets allowedHeaders of Bucket CORS.

Returns:
allowedHeaders of Bucket CORS.

setAllowedHeaders

public void setAllowedHeaders(List<String> allowedHeaders)
Sets allowedHeaders of Bucket CORS.

Parameters:
allowedHeaders - The allowedHeaders of Bucket CORS.

withAllowedHeaders

public CorsConfiguration withAllowedHeaders(List<String> allowedHeaders)
Sets allowedHeaders of Bucket CORS.

Parameters:
allowedHeaders - The allowedHeaders of Bucket CORS.
Returns:
this object.

getAllowedExposeHeaders

public List<String> getAllowedExposeHeaders()
Gets allowedExposeHeaders of Bucket CORS.

Returns:
allowedExposeHeaders of Bucket CORS.

setAllowedExposeHeaders

public void setAllowedExposeHeaders(List<String> allowedExposeHeaders)
Sets allowedExposeHeaders of Bucket CORS.

Parameters:
allowedExposeHeaders - The allowedExposeHeaders of Bucket CORS.

withAllowedExposeHeaders

public CorsConfiguration withAllowedExposeHeaders(List<String> allowedExposeHeaders)
Sets allowedExposeHeaders of Bucket CORS.

Parameters:
allowedExposeHeaders - The allowedExposeHeaders of Bucket CORS.
Returns:
this object.

getMaxAgeSeconds

public int getMaxAgeSeconds()
Gets maxAgeSeconds of Bucket CORS.

Returns:
maxAgeSeconds of Bucket CORS.

setMaxAgeSeconds

public void setMaxAgeSeconds(int maxAgeSeconds)
Sets maxAgeSeconds of Bucket CORS.

Parameters:
maxAgeSeconds - The maxAgeSeconds of Bucket CORS.

withMaxAgeSeconds

public CorsConfiguration withMaxAgeSeconds(int maxAgeSeconds)
Sets maxAgeSeconds of Bucket CORS.

Parameters:
maxAgeSeconds - The maxAgeSeconds of Bucket CORS.
Returns:
this object.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2018. All rights reserved.