CorsRule Class
- java.
lang. Object - com.
microsoft. azure. storage. CorsRule
- com.
public class CorsRule
Represents a Cross-Origin Resource Sharing (CORS) rule.
Method Summary
Modifier and Type | Method and Description |
---|---|
List<String> |
getAllowedHeaders()
Gets the allowed headers. |
EnumSet<Cors |
getAllowedMethods()
Gets the allowed methods. |
List<String> |
getAllowedOrigins()
Gets the allowed origins. |
List<String> |
getExposedHeaders()
Gets the exposed headers. |
int |
getMaxAgeInSeconds()
Gets the maximum age in seconds. |
void |
setAllowedHeaders(List<String> allowedHeaders)
Sets the allowed headers. Limited to 64 defined headers and two prefixed headers, no more than 256 characters each. |
void |
setAllowedMethods(EnumSet<CorsHttpMethods> allowedMethods)
Sets the allowed methods. |
void |
setAllowedOrigins(List<String> allowedOrigins)
Sets the allowed origins. Limited to 64 origins OR "*" to allow all origins, no more than 256 characters each. |
void |
setExposedHeaders(List<String> exposedHeaders)
Sets the exposed headers. Limited to 64 defined headers and two prefixed headers, no more than 256 characters each. |
void |
setMaxAgeInSeconds(int maxAgeInSeconds)
Sets the maximum age in seconds. |
Method Details
getAllowedHeaders
public List
Gets the allowed headers.
Returns:
List
object which contains the allowed headers.getAllowedMethods
public EnumSet
Gets the allowed methods.
Returns:
List
object which contains the allowed methods.getAllowedOrigins
public List
Gets the allowed origins.
Returns:
List
object which contains the allowed origins.getExposedHeaders
public List
Gets the exposed headers.
Returns:
List
object which contains the exposed headers.getMaxAgeInSeconds
public int getMaxAgeInSeconds()
Gets the maximum age in seconds.
Returns:
int
which represents the the maximum age in seconds.setAllowedHeaders
public void setAllowedHeaders(List
Sets the allowed headers.
Limited to 64 defined headers and two prefixed headers, no more than 256 characters each.
Parameters:
List
object which contains the allowed headers.
setAllowedMethods
public void setAllowedMethods(EnumSet
Sets the allowed methods.
Parameters:
List
object which contains the allowed methods.
setAllowedOrigins
public void setAllowedOrigins(List
Sets the allowed origins.
Limited to 64 origins OR "*" to allow all origins, no more than 256 characters each.
Parameters:
List
object which contains the allowed origins.
setExposedHeaders
public void setExposedHeaders(List
Sets the exposed headers.
Limited to 64 defined headers and two prefixed headers, no more than 256 characters each.
Parameters:
List
object which contains the exposed headers.
setMaxAgeInSeconds
public void setMaxAgeInSeconds(int maxAgeInSeconds)
Sets the maximum age in seconds.
Parameters:
int
which represents the the maximum age in seconds.
Applies to
Azure SDK for Java