CorsRule Class
- java.
lang. Object - com.
azure. resourcemanager. storage. models. CorsRule
- com.
Implements
public final class CorsRule
implements JsonSerializable<CorsRule>
Specifies a CORS rule for the Blob service.
Constructor Summary
Constructor | Description |
---|---|
CorsRule() |
Creates an instance of Cors |
Method Summary
Modifier and Type | Method and Description |
---|---|
List<String> |
allowedHeaders()
Get the allowed |
List<Cors |
allowedMethods()
Get the allowed |
List<String> |
allowedOrigins()
Get the allowed |
List<String> |
exposedHeaders()
Get the exposed |
static
Cors |
fromJson(JsonReader jsonReader)
Reads an instance of Cors |
int |
maxAgeInSeconds()
Get the max |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Cors |
withAllowedHeaders(List<String> allowedHeaders)
Set the allowed |
Cors |
withAllowedMethods(List<CorsRuleAllowedMethodsItem> allowedMethods)
Set the allowed |
Cors |
withAllowedOrigins(List<String> allowedOrigins)
Set the allowed |
Cors |
withExposedHeaders(List<String> exposedHeaders)
Set the exposed |
Cors |
withMaxAgeInSeconds(int maxAgeInSeconds)
Set the max |
Methods inherited from java.lang.Object
Constructor Details
CorsRule
public CorsRule()
Creates an instance of CorsRule class.
Method Details
allowedHeaders
public List
Get the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.
Returns:
allowedMethods
public List
Get the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.
Returns:
allowedOrigins
public List
Get the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains.
Returns:
exposedHeaders
public List
Get the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to CORS clients.
Returns:
fromJson
public static CorsRule fromJson(JsonReader jsonReader)
Reads an instance of CorsRule from the JsonReader.
Parameters:
Returns:
Throws:
maxAgeInSeconds
public int maxAgeInSeconds()
Get the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response.
Returns:
toJson
validate
public void validate()
Validates the instance.
withAllowedHeaders
public CorsRule withAllowedHeaders(List
Set the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.
Parameters:
Returns:
withAllowedMethods
public CorsRule withAllowedMethods(List
Set the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.
Parameters:
Returns:
withAllowedOrigins
public CorsRule withAllowedOrigins(List
Set the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains.
Parameters:
Returns:
withExposedHeaders
public CorsRule withExposedHeaders(List
Set the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to CORS clients.
Parameters:
Returns:
withMaxAgeInSeconds
public CorsRule withMaxAgeInSeconds(int maxAgeInSeconds)
Set the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response.
Parameters:
Returns:
Applies to
Azure SDK for Java