Use the AWS SDK for Java V2 with Backblaze B2
    • Dark
      Light

    Use the AWS SDK for Java V2 with Backblaze B2

    • Dark
      Light

    Article summary

    Data Integrity Protection Headers
    AWS Java v2 SDK versions released after version 2.29.52 have data integrity protection headers enabled by default. These headers can include any of the following:

    • x-amz-checksum-crc32
    • x-amz-checksum-crc32c
    • x-amz-checksum-crc64nvme
    • x-amz-checksum-sha1
    • x-amz-checksum-sha256
    • x-amz-checksum-algorithm
    • x-amz-checksum-mode

    Backblaze does not yet accept these headers, so we recommend downgrading to AWS Java v2 SDK version 2.29.52.


    You can take advantage of Backblaze B2 Cloud Storage using the AWS SDK for Java V2 alongside the Backblaze S3-Compatible API.

    The following example shows an account with an S3 endpoint of s3.us-west-002.backblazeb2.com:

    Region region = Region.US_WEST_002;
    
    final String END_POINT = "https://s3.us-west-002.backblazeb2.com";
    AwsSessionCredentials awsCreds = AwsSessionCredentials.create(ACCESS_KEY, SECRET_ACCESS_KEY, "");
    
    S3Client s3 = S3Client.builder().credentialsProvider(
    
                StaticCredentialsProvider.create(awsCreds))
    .endpointOverride(URI.create(END_POINT)).region(region).build();

    The S3-Compatible API allows 1000’s of integrations to natively work with Backblaze B2. If you are new to the S3-Compatible API, click here. If you have issues using this SDK with Backblaze B2, let us know by emailing us at [email protected].


    Was this article helpful?