CorsRule Class

  • java.lang.Object
    • com.microsoft.azure.storage.CorsRule

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<CorsHttpMethods> 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 getAllowedHeaders()

Gets the allowed headers.

Returns:

A List object which contains the allowed headers.

getAllowedMethods

public EnumSet getAllowedMethods()

Gets the allowed methods.

Returns:

A List object which contains the allowed methods.

getAllowedOrigins

public List getAllowedOrigins()

Gets the allowed origins.

Returns:

A List object which contains the allowed origins.

getExposedHeaders

public List getExposedHeaders()

Gets the exposed headers.

Returns:

A List object which contains the exposed headers.

getMaxAgeInSeconds

public int getMaxAgeInSeconds()

Gets the maximum age in seconds.

Returns:

An int which represents the the maximum age in seconds.

setAllowedHeaders

public void setAllowedHeaders(List allowedHeaders)

Sets the allowed headers.

Limited to 64 defined headers and two prefixed headers, no more than 256 characters each.

Parameters:

allowedHeaders - A List object which contains the allowed headers.

setAllowedMethods

public void setAllowedMethods(EnumSet allowedMethods)

Sets the allowed methods.

Parameters:

allowedMethods - A List object which contains the allowed methods.

setAllowedOrigins

public void setAllowedOrigins(List allowedOrigins)

Sets the allowed origins.

Limited to 64 origins OR "*" to allow all origins, no more than 256 characters each.

Parameters:

allowedOrigins - A List object which contains the allowed origins.

setExposedHeaders

public void setExposedHeaders(List exposedHeaders)

Sets the exposed headers.

Limited to 64 defined headers and two prefixed headers, no more than 256 characters each.

Parameters:

exposedHeaders - A List object which contains the exposed headers.

setMaxAgeInSeconds

public void setMaxAgeInSeconds(int maxAgeInSeconds)

Sets the maximum age in seconds.

Parameters:

maxAgeInSeconds - An int which represents the the maximum age in seconds.

Applies to