Class CorsRule


  • public final class CorsRule
    extends Object
    Specifies a CORS rule for the Blob service.
    • Constructor Detail

      • CorsRule

        public CorsRule()
    • Method Detail

      • allowedOrigins

        public List<String> allowedOrigins()
        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:
        the allowedOrigins value.
      • withAllowedOrigins

        public CorsRule withAllowedOrigins​(List<String> allowedOrigins)
        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:
        allowedOrigins - the allowedOrigins value to set.
        Returns:
        the CorsRule object itself.
      • allowedMethods

        public List<CorsRuleAllowedMethodsItem> allowedMethods()
        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:
        the allowedMethods value.
      • withAllowedMethods

        public CorsRule withAllowedMethods​(List<CorsRuleAllowedMethodsItem> allowedMethods)
        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:
        allowedMethods - the allowedMethods value to set.
        Returns:
        the CorsRule object itself.
      • 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:
        the maxAgeInSeconds value.
      • 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:
        maxAgeInSeconds - the maxAgeInSeconds value to set.
        Returns:
        the CorsRule object itself.
      • exposedHeaders

        public List<String> exposedHeaders()
        Get the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to CORS clients.
        Returns:
        the exposedHeaders value.
      • withExposedHeaders

        public CorsRule withExposedHeaders​(List<String> exposedHeaders)
        Set the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to CORS clients.
        Parameters:
        exposedHeaders - the exposedHeaders value to set.
        Returns:
        the CorsRule object itself.
      • allowedHeaders

        public List<String> allowedHeaders()
        Get the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.
        Returns:
        the allowedHeaders value.
      • withAllowedHeaders

        public CorsRule withAllowedHeaders​(List<String> allowedHeaders)
        Set the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.
        Parameters:
        allowedHeaders - the allowedHeaders value to set.
        Returns:
        the CorsRule object itself.
      • validate

        public void validate()
        Validates the instance.
        Throws:
        IllegalArgumentException - thrown if the instance is not valid.