Class ChecksumConfig


  • public class ChecksumConfig
    extends java.lang.Object
    • Constructor Detail

      • ChecksumConfig

        public ChecksumConfig()
    • Method Detail

      • withChecksumLocation

        public ChecksumConfig withChecksumLocation​(ChecksumConfig.ChecksumLocation location)
        If NONE. No request payload checksum will be added and calculated. If HEADER, the checksum will be calculated by client and related header added to the request sent. If TRAILER, the payload will be aws_chunked encoded, The checksum will be calculated while reading the payload by client. Related header will be added to the trailer part of the encoded payload. Note the payload of the original request cannot be aws-chunked encoded already. Otherwise, error will be raised.
        Parameters:
        location - The location of client added request payload checksum header.
        Returns:
        this
      • withChecksumAlgorithm

        public ChecksumConfig withChecksumAlgorithm​(ChecksumAlgorithm algorithm)
        The checksum algorithm used to calculate the checksum of payload uploaded. Must be set if location is not AWS_SCL_NONE. Must be AWS_SCA_NONE if location is AWS_SCL_NONE.
        Parameters:
        algorithm - The checksum algorithm used to calculate the checksum of payload uploaded.
        Returns:
        this
      • getChecksumAlgorithm

        public ChecksumAlgorithm getChecksumAlgorithm()
        Returns:
        The checksum algorithm used to calculate the checksum of payload uploaded.
      • withValidateChecksum

        public ChecksumConfig withValidateChecksum​(boolean validateChecksum)
        Enable checksum mode header will be attached to get requests, this will tell s3 to send back checksums headers if they exist. For object that has checksum, the checksum of whole object will be calculated and validated. The result will finish with a did validate field. For object has checksum for parts, if ALL the parts have been validated, the result will finish with a did validate field. If any part failed the validation, AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH will be raised.
        Parameters:
        validateChecksum - Validate the checksum of response if server provides.
        Returns:
        this
      • getValidateChecksum

        public boolean getValidateChecksum()
      • withValidateChecksumAlgorithmList

        public ChecksumConfig withValidateChecksumAlgorithmList​(java.util.List<ChecksumAlgorithm> validateChecksumAlgorithmList)
        Ignored when validate_response_checksum is not set. If not set all the algorithms will be selected as default behavior. The list of algorithms for user to pick up when validate the checksum. Client will pick up the algorithm from the list with the priority based on performance, and the algorithm sent by server. The priority based on performance is [CRC32C, CRC32, SHA1, SHA256]. If the response checksum was validated by client, the result will indicate which algorithm was picked.
        Parameters:
        validateChecksumAlgorithmList - The list of algorithm picked to validate checksum from response.
        Returns:
        this
      • getValidateChecksumAlgorithmList

        public java.util.List<ChecksumAlgorithm> getValidateChecksumAlgorithmList()
        Returns:
        The list of algorithm picked to validate checksum from response.