AWS SDK Java having issue with getting bucket location

Here is a piece of code based on AWS Java SDK, the bucket location always gives as "default", which is incorrect.

AmazonS3 s3Client = getS3ClientConnection(Regions.US_EAST_1.getName());

GetBucketLocationRequest req = new GetBucketLocationRequest(b.getName());

String loc = s3Client.getBucketLocation(req);

1 Reply

Hey @Nanda. Since I'm not super familiar with the AWS Java SDK syntax, I'm not sure why you're getting "default" as a persistent location. One of our Object Storage engineers was able to track down some resources that might point you in the right direction, though.

Linode Object Storage uses Ceph. Most SDKs in this list work out of the box, but there may be some tinkering needed since not all s3 SDKs are 100% compatible with Ceph. This post directly from Ceph has examples of compatible Java syntax:

Java s3 Examples

And here's Amazon's guide on using their Java SDK:

Amazon S3 Examples Using the AWS SDK for Java

I'm not sure what you've tried already, but hopefully these help!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct