Interface BucketCorsRule.Builder

  • Method Details

    • id

      A unique identifier for the CORS rule. The ID value can be up to 255 characters long. The IDs help you find a rule in the configuration.

      Parameters:
      id - A unique identifier for the CORS rule. The ID value can be up to 255 characters long. The IDs help you find a rule in the configuration.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • allowedMethods

      BucketCorsRule.Builder allowedMethods(Collection<String> allowedMethods)

      The HTTP methods that are allowed when accessing the bucket from the specified origin. Each CORS rule must identify at least one origin and one method.

      You can use the following HTTP methods:

      • GET - Retrieves data from the server, such as downloading files or viewing content.

      • PUT - Uploads or replaces data on the server, such as uploading new files.

      • POST - Sends data to the server for processing, such as submitting forms or creating new resources.

      • DELETE - Removes data from the server, such as deleting files or resources.

      • HEAD - Retrieves only the headers from the server without the actual content, useful for checking if a resource exists.

      Parameters:
      allowedMethods - The HTTP methods that are allowed when accessing the bucket from the specified origin. Each CORS rule must identify at least one origin and one method.

      You can use the following HTTP methods:

      • GET - Retrieves data from the server, such as downloading files or viewing content.

      • PUT - Uploads or replaces data on the server, such as uploading new files.

      • POST - Sends data to the server for processing, such as submitting forms or creating new resources.

      • DELETE - Removes data from the server, such as deleting files or resources.

      • HEAD - Retrieves only the headers from the server without the actual content, useful for checking if a resource exists.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • allowedMethods

      BucketCorsRule.Builder allowedMethods(String... allowedMethods)

      The HTTP methods that are allowed when accessing the bucket from the specified origin. Each CORS rule must identify at least one origin and one method.

      You can use the following HTTP methods:

      • GET - Retrieves data from the server, such as downloading files or viewing content.

      • PUT - Uploads or replaces data on the server, such as uploading new files.

      • POST - Sends data to the server for processing, such as submitting forms or creating new resources.

      • DELETE - Removes data from the server, such as deleting files or resources.

      • HEAD - Retrieves only the headers from the server without the actual content, useful for checking if a resource exists.

      Parameters:
      allowedMethods - The HTTP methods that are allowed when accessing the bucket from the specified origin. Each CORS rule must identify at least one origin and one method.

      You can use the following HTTP methods:

      • GET - Retrieves data from the server, such as downloading files or viewing content.

      • PUT - Uploads or replaces data on the server, such as uploading new files.

      • POST - Sends data to the server for processing, such as submitting forms or creating new resources.

      • DELETE - Removes data from the server, such as deleting files or resources.

      • HEAD - Retrieves only the headers from the server without the actual content, useful for checking if a resource exists.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • allowedOrigins

      BucketCorsRule.Builder allowedOrigins(Collection<String> allowedOrigins)

      One or more origins you want customers to be able to access the bucket from. Each CORS rule must identify at least one origin and one method.

      Parameters:
      allowedOrigins - One or more origins you want customers to be able to access the bucket from. Each CORS rule must identify at least one origin and one method.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • allowedOrigins

      BucketCorsRule.Builder allowedOrigins(String... allowedOrigins)

      One or more origins you want customers to be able to access the bucket from. Each CORS rule must identify at least one origin and one method.

      Parameters:
      allowedOrigins - One or more origins you want customers to be able to access the bucket from. Each CORS rule must identify at least one origin and one method.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • allowedHeaders

      BucketCorsRule.Builder allowedHeaders(Collection<String> allowedHeaders)

      Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.

      Parameters:
      allowedHeaders - Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • allowedHeaders

      BucketCorsRule.Builder allowedHeaders(String... allowedHeaders)

      Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.

      Parameters:
      allowedHeaders - Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • exposeHeaders

      BucketCorsRule.Builder exposeHeaders(Collection<String> exposeHeaders)

      One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).

      Parameters:
      exposeHeaders - One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • exposeHeaders

      BucketCorsRule.Builder exposeHeaders(String... exposeHeaders)

      One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).

      Parameters:
      exposeHeaders - One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • maxAgeSeconds

      BucketCorsRule.Builder maxAgeSeconds(Integer maxAgeSeconds)

      The time in seconds that your browser is to cache the preflight response for the specified resource. A CORS rule can have only one maxAgeSeconds element.

      Parameters:
      maxAgeSeconds - The time in seconds that your browser is to cache the preflight response for the specified resource. A CORS rule can have only one maxAgeSeconds element.
      Returns:
      Returns a reference to this object so that method calls can be chained together.