类 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.
    • 构造器详细资料

      • 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.
        参数:
        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.
    • 方法详细资料

      • getAllowedOrigins

        public List<String> getAllowedOrigins()
        Gets allowedOrigins of Bucket CORS.
        返回:
        allowedOrigins of Bucket CORS.
      • setAllowedOrigins

        public void setAllowedOrigins​(List<String> allowedOrigins)
        Sets allowedOrigins of Bucket CORS.
        参数:
        allowedOrigins - The allowedOrigins of Bucket CORS.
      • withAllowedOrigins

        public CorsConfiguration withAllowedOrigins​(List<String> allowedOrigins)
        Sets allowedOrigins of Bucket CORS.
        参数:
        allowedOrigins - The allowedOrigins of Bucket CORS.
        返回:
        this object.
      • getAllowedMethods

        public List<AllowedMethods> getAllowedMethods()
        Gets allowedMethods of Bucket CORS.
        返回:
        allowedMethods of Bucket CORS.
      • setAllowedMethods

        public void setAllowedMethods​(List<AllowedMethods> allowedMethods)
        Sets allowedMethods of Bucket CORS.
        参数:
        allowedMethods - The allowedMethods of Bucket CORS.
      • withAllowedMethods

        public CorsConfiguration withAllowedMethods​(List<AllowedMethods> allowedMethods)
        Sets allowedMethods of Bucket CORS.
        参数:
        allowedMethods - The allowedMethods of Bucket CORS.
        返回:
        this object.
      • getAllowedHeaders

        public List<String> getAllowedHeaders()
        Gets allowedHeaders of Bucket CORS.
        返回:
        allowedHeaders of Bucket CORS.
      • setAllowedHeaders

        public void setAllowedHeaders​(List<String> allowedHeaders)
        Sets allowedHeaders of Bucket CORS.
        参数:
        allowedHeaders - The allowedHeaders of Bucket CORS.
      • withAllowedHeaders

        public CorsConfiguration withAllowedHeaders​(List<String> allowedHeaders)
        Sets allowedHeaders of Bucket CORS.
        参数:
        allowedHeaders - The allowedHeaders of Bucket CORS.
        返回:
        this object.
      • getAllowedExposeHeaders

        public List<String> getAllowedExposeHeaders()
        Gets allowedExposeHeaders of Bucket CORS.
        返回:
        allowedExposeHeaders of Bucket CORS.
      • setAllowedExposeHeaders

        public void setAllowedExposeHeaders​(List<String> allowedExposeHeaders)
        Sets allowedExposeHeaders of Bucket CORS.
        参数:
        allowedExposeHeaders - The allowedExposeHeaders of Bucket CORS.
      • withAllowedExposeHeaders

        public CorsConfiguration withAllowedExposeHeaders​(List<String> allowedExposeHeaders)
        Sets allowedExposeHeaders of Bucket CORS.
        参数:
        allowedExposeHeaders - The allowedExposeHeaders of Bucket CORS.
        返回:
        this object.
      • getMaxAgeSeconds

        public int getMaxAgeSeconds()
        Gets maxAgeSeconds of Bucket CORS.
        返回:
        maxAgeSeconds of Bucket CORS.
      • setMaxAgeSeconds

        public void setMaxAgeSeconds​(int maxAgeSeconds)
        Sets maxAgeSeconds of Bucket CORS.
        参数:
        maxAgeSeconds - The maxAgeSeconds of Bucket CORS.
      • withMaxAgeSeconds

        public CorsConfiguration withMaxAgeSeconds​(int maxAgeSeconds)
        Sets maxAgeSeconds of Bucket CORS.
        参数:
        maxAgeSeconds - The maxAgeSeconds of Bucket CORS.
        返回:
        this object.