AWS SDK JAVA V2 - How do I get bucket name when I have S3Object instance? #6558
-
|
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.
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.
-
|
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
@karthika-49 you can obtain the bucket name from the ListObjectsV2 response itself - ListObjectsV2Response#name