Class S3ObjectResource
- java.lang.Object
-
- software.amazon.awssdk.services.s3.internal.resource.S3ObjectResource
-
- All Implemented Interfaces:
AwsResource
,S3Resource
public final class S3ObjectResource extends Object implements S3Resource
AnS3Resource
that represents an S3 object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
S3ObjectResource.Builder
A builder forS3ObjectResource
objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
accountId()
Gets the AWS account ID associated with the S3 object if it has been specified.static S3ObjectResource.Builder
builder()
Get a new builder for this class.boolean
equals(Object o)
int
hashCode()
String
key()
Gets the key of the S3 object.Optional<S3Resource>
parentS3Resource()
Gets the optional parent resource.Optional<String>
partition()
Gets the AWS partition name associated with the S3 object (e.g.: 'aws').Optional<String>
region()
Gets the AWS region name associated with the S3 object (e.g.: 'us-east-1').String
type()
Gets the resource type for this S3 object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.services.s3.internal.resource.S3Resource
overrideSigner
-
-
-
-
Method Detail
-
builder
public static S3ObjectResource.Builder builder()
Get a new builder for this class.- Returns:
- A newly initialized instance of a builder.
-
type
public String type()
Gets the resource type for this S3 object.- Specified by:
type
in interfaceS3Resource
- Returns:
- This will always return "object".
-
partition
public Optional<String> partition()
Gets the AWS partition name associated with the S3 object (e.g.: 'aws').- Specified by:
partition
in interfaceAwsResource
- Returns:
- the name of the partition.
-
region
public Optional<String> region()
Gets the AWS region name associated with the S3 object (e.g.: 'us-east-1').- Specified by:
region
in interfaceAwsResource
- Returns:
- the name of the region or null if the region has not been specified (e.g. the resource is in the global namespace).
-
accountId
public Optional<String> accountId()
Gets the AWS account ID associated with the S3 object if it has been specified.- Specified by:
accountId
in interfaceAwsResource
- Returns:
- the optional AWS account ID or empty if the account ID has not been specified.
-
key
public String key()
Gets the key of the S3 object.- Returns:
- the key of the S3 object.
-
parentS3Resource
public Optional<S3Resource> parentS3Resource()
Description copied from interface:S3Resource
Gets the optional parent resource.- Specified by:
parentS3Resource
in interfaceS3Resource
- Returns:
- the optional parent resource.
-
-