AWS SDK JAVA V2 - How do I get bucket name when I have S3Object instance? #6558
Answered
by
debora-ito
karthika-49
asked this question in
Migration from v1 to v2
-
|
In AWS SDK v1, we could use the getBucketName() method from S3ObjectSummary to retrieve the bucket name. However, in AWS SDK v2, the S3Object class doesn’t seem to provide a similar method. Could you please suggest how we can get the bucket name of an object in AWS SDK v2? |
Beta Was this translation helpful? Give feedback.
Answered by
debora-ito
Nov 12, 2025
Replies: 2 comments
-
|
@karthika-49 you can obtain the bucket name from the ListObjectsV2 response itself - ListObjectsV2Response#name |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
karthika-49
-
|
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@karthika-49 you can obtain the bucket name from the ListObjectsV2 response itself - ListObjectsV2Response#name