public class PutObjectResult extends SSEResultBase implements ObjectExpirationResult, S3RequesterChargedResult, S3VersionResult, java.io.Serializable
putObject
operation.
Use this class to access information about the new object created from the
putObject
request, such as its ETag and optional version ID.
This class also contains the MD5 hash of the object content calculated on the client-side.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
contentMd5
The content MD5
|
private java.lang.String |
eTag
The ETag value of the new object
|
private java.util.Date |
expirationTime
The time this object expires, or null if it has no expiration
|
private java.lang.String |
expirationTimeRuleId
The expiration rule for this object
|
private boolean |
isRequesterCharged
Indicate if the requester is charged for conducting this operation from
Requester Pays Buckets.
|
private ObjectMetadata |
metadata
The metadata returned as a result of PutObject operation.
|
private java.lang.String |
versionId
The version ID of the new, uploaded object.
|
Constructor and Description |
---|
PutObjectResult() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentMd5()
Returns the Base64-encoded MD5 hash of the object content that was
calculated on the client-side.
|
java.lang.String |
getETag()
Gets the server-side ETag value for the newly created object.
|
java.util.Date |
getExpirationTime()
Returns the expiration time for this object, or null if it doesn't expire.
|
java.lang.String |
getExpirationTimeRuleId()
Returns the
BucketLifecycleConfiguration rule ID for this
object's expiration, or null if it doesn't expire. |
ObjectMetadata |
getMetadata()
Returns the metadata retrieved as a response to
AmazonS3Client.putObject(PutObjectRequest) operation. |
java.lang.String |
getVersionId()
Gets the optional version ID of the newly uploaded object.
|
boolean |
isRequesterCharged()
Returns true if the user has enabled Requester Pays option when
conducting this operation from Requester Pays Bucket; else false.
|
void |
setContentMd5(java.lang.String contentMd5)
Sets the Base64-encoded MD5 hash of the object content that was
calculated on the client-side.
|
void |
setETag(java.lang.String eTag)
Sets the ETag value for the new object that was created from the
associated
putObject request. |
void |
setExpirationTime(java.util.Date expirationTime)
Sets the expiration time for the object.
|
void |
setExpirationTimeRuleId(java.lang.String expirationTimeRuleId)
Sets the
BucketLifecycleConfiguration rule ID for this object's
expiration |
void |
setMetadata(ObjectMetadata metadata)
Sets the metadata retrieved as a response to
AmazonS3Client.putObject(PutObjectRequest) operation. |
void |
setRequesterCharged(boolean isRequesterCharged)
Used for conducting this operation from a Requester Pays Bucket.
|
void |
setVersionId(java.lang.String versionId)
Sets the optional version ID of the newly uploaded object.
|
getServerSideEncryption, getSSEAlgorithm, getSSECustomerAlgorithm, getSSECustomerKeyMd5, setSSEAlgorithm, setSSECustomerAlgorithm, setSSECustomerKeyMd5
private java.lang.String versionId
private java.lang.String eTag
private java.util.Date expirationTime
private java.lang.String expirationTimeRuleId
private java.lang.String contentMd5
private ObjectMetadata metadata
private boolean isRequesterCharged
public java.lang.String getVersionId()
getVersionId
in interface S3VersionResult
setVersionId(String)
public void setVersionId(java.lang.String versionId)
setVersionId
in interface S3VersionResult
versionId
- The optional version ID of the newly uploaded object.getVersionId()
public java.lang.String getETag()
setETag(String)
public void setETag(java.lang.String eTag)
putObject
request.eTag
- The ETag value for the new object.getETag()
public java.util.Date getExpirationTime()
getExpirationTime
in interface ObjectExpirationResult
public void setExpirationTime(java.util.Date expirationTime)
setExpirationTime
in interface ObjectExpirationResult
expirationTime
- The expiration time for the object.public java.lang.String getExpirationTimeRuleId()
BucketLifecycleConfiguration
rule ID for this
object's expiration, or null if it doesn't expire.getExpirationTimeRuleId
in interface ObjectExpirationResult
BucketLifecycleConfiguration.Rule.getId()
public void setExpirationTimeRuleId(java.lang.String expirationTimeRuleId)
BucketLifecycleConfiguration
rule ID for this object's
expirationsetExpirationTimeRuleId
in interface ObjectExpirationResult
expirationTimeRuleId
- The rule ID for this object's expirationpublic void setContentMd5(java.lang.String contentMd5)
contentMd5
- The content MD5public java.lang.String getContentMd5()
public ObjectMetadata getMetadata()
AmazonS3Client.putObject(PutObjectRequest)
operation.public void setMetadata(ObjectMetadata metadata)
AmazonS3Client.putObject(PutObjectRequest)
operation.public boolean isRequesterCharged()
S3RequesterChargedResult
If a bucket is enabled for Requester Pays, then any attempt of operation from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
Enabling Requester Pays disables the ability to have anonymous access to this bucket
isRequesterCharged
in interface S3RequesterChargedResult
public void setRequesterCharged(boolean isRequesterCharged)
S3RequesterChargedResult
If a bucket is enabled for Requester Pays, then any attempt of operation from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.
setRequesterCharged
in interface S3RequesterChargedResult
isRequesterCharged
- Indicates requester is charged for this operation.