Class S3MetaRequestOptions


  • public class S3MetaRequestOptions
    extends Object
    • Constructor Detail

      • S3MetaRequestOptions

        public S3MetaRequestOptions()
    • Method Detail

      • withOperationName

        public S3MetaRequestOptions withOperationName​(String operationName)
        The S3 operation name (eg: "CreateBucket"), this MUST be set for S3MetaRequestOptions.MetaRequestType.DEFAULT, it is ignored for other meta request types since the operation is implicit. See S3 API documentation for the canonical list of names. This name is used to fill out details in metrics and error reports. It also drives some operation-specific behavior. If you pass the wrong name, you risk getting the wrong behavior. For example, every operation except "GetObject" has its response checked for error, even if the HTTP status-code was 200 OK (see knowledge center). If you used the DEFAULT type to do GetObject, but mis-named it "Download", and the object looked like XML with an error code, then the meta-request would fail. You risk logging the full response body, and leaking sensitive data.
        Parameters:
        operationName - the operation name for this S3MetaRequestOptions.MetaRequestType.DEFAULT meta request
        Returns:
        this
      • getOperationName

        public String getOperationName()
      • withChecksumConfig

        public S3MetaRequestOptions withChecksumConfig​(ChecksumConfig checksumConfig)
        The config related to checksum used for the meta request. See ChecksumConfig for details.
        Parameters:
        checksumConfig - The checksum config used for the meta request
        Returns:
        this
      • withChecksumAlgorithm

        public S3MetaRequestOptions withChecksumAlgorithm​(ChecksumAlgorithm checksumAlgorithm)
        Deprecated.
        Please use withChecksumConfig(ChecksumConfig) instead. Specify the checksum algorithm to use use for put requests, if unset defaults to NONE and no checksum will be calculated. The location of the checksum will be default to trailer.
        Parameters:
        checksumAlgorithm - the checksum algorithm to use use for put requests
        Returns:
        this
      • getChecksumAlgorithm

        public ChecksumAlgorithm getChecksumAlgorithm()
        Deprecated.
        Returns:
        the checksum algorithm to use use for put requests
      • withValidateChecksum

        public S3MetaRequestOptions withValidateChecksum​(boolean validateChecksum)
        Deprecated.
        Please use withChecksumConfig(ChecksumConfig) instead. validateChecksum defaults to false, if set to true, it will cause the client to compare a streamed calculation of the objects checksum to a remotely stored checksum assigned to the object if one exists. The checksumValidated field passed in parameter of the finished callback will inform the user if validation ocurred. A mismatch will result in a AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH error
        Parameters:
        validateChecksum - Validate the checksum of response if server provides.
        Returns:
        this
      • getValidateChecksum

        public boolean getValidateChecksum()
        Deprecated.
        Returns:
        Validate the checksum of response if server provides.
      • withHttpRequest

        public S3MetaRequestOptions withHttpRequest​(HttpRequest httpRequest)
        Set the initial HTTP request. Note: When uploading a file, you can get better performance by setting withRequestFilePath(java.nio.file.Path) instead of setting a body stream on the HttpRequest. (If both are set, the file path is used and body stream is ignored)
        Parameters:
        httpRequest - initial HTTP request message.
        Returns:
        this
      • getRequestFilePath

        public Path getRequestFilePath()
      • withCredentialsProvider

        public S3MetaRequestOptions withCredentialsProvider​(CredentialsProvider credentialsProvider)
        Deprecated.
        Please use withSigningConfig(AwsSigningConfig) instead. The credentials provider will be used to create the signing Config to override the client level config. The client config will be used.
        Parameters:
        credentialsProvider - provide credentials for signing.
        Returns:
        this
      • withSigningConfig

        public S3MetaRequestOptions withSigningConfig​(AwsSigningConfig signingConfig)
        The configuration related to signing used by S3 client. It will override the client level configuration if provided. `AwsSigningConfig.getDefaultS3SigningConfig(region, credentialsProvider);` can be used as helper to create the default configuration to be used for S3. If not set, the client configuration will be used. If set: - All fields are optional. The credentials will be resolve from client if not set. - S3 Client will derive the right config for signing process based on this. Notes: - For SIGV4_S3EXPRESS, S3 client will use the credentials in the config to derive the S3Express credentials that are used in the signing process. - Client may make modifications to signing config before passing it on to signer.
        Parameters:
        signingConfig - configuration related to signing via an AWS signing process.
        Returns:
        this
      • getEndpoint

        public URI getEndpoint()
      • getObjectSizeHint

        public Long getObjectSizeHint()
      • getResponseFilePath

        public Path getResponseFilePath()
      • getResponseFilePosition

        public long getResponseFilePosition()
      • withResponseFileDeleteOnFailure

        public S3MetaRequestOptions withResponseFileDeleteOnFailure​(boolean responseFileDeleteOnFailure)
        Sets whether to delete the response file on failure when downloading an object from S3. This option is only applicable when a response file path is set.
        Parameters:
        responseFileDeleteOnFailure - True to delete the response file on failure, False to leave it as-is.
        Returns:
        this
      • getResponseFileDeleteOnFailure

        public boolean getResponseFileDeleteOnFailure()