Package com.amazonaws.services.s3.model
Class PutObjectResult
- java.lang.Object
-
- com.amazonaws.services.s3.internal.SSEResultBase
-
- com.amazonaws.services.s3.model.PutObjectResult
-
- All Implemented Interfaces:
com.amazonaws.services.s3.internal.ObjectExpirationResult
,com.amazonaws.services.s3.internal.S3RequesterChargedResult
,com.amazonaws.services.s3.internal.S3VersionResult
,com.amazonaws.services.s3.internal.ServerSideEncryptionResult
,Serializable
public class PutObjectResult extends com.amazonaws.services.s3.internal.SSEResultBase implements com.amazonaws.services.s3.internal.ObjectExpirationResult, com.amazonaws.services.s3.internal.S3RequesterChargedResult, com.amazonaws.services.s3.internal.S3VersionResult, Serializable
Contains the data returned by Amazon S3 from theputObject
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.
-
-
Constructor Summary
Constructors Constructor Description PutObjectResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContentMd5()
Returns the Base64-encoded MD5 hash of the object content that was calculated on the client-side.String
getETag()
Gets the server-side ETag value for the newly created object.Date
getExpirationTime()
Returns the expiration time for this object, or null if it doesn't expire.String
getExpirationTimeRuleId()
Returns theBucketLifecycleConfiguration
rule ID for this object's expiration, or null if it doesn't expire.ObjectMetadata
getMetadata()
Returns the metadata retrieved as a response toAmazonS3Client.putObject(PutObjectRequest)
operation.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(String contentMd5)
Sets the Base64-encoded MD5 hash of the object content that was calculated on the client-side.void
setETag(String eTag)
Sets the ETag value for the new object that was created from the associatedputObject
request.void
setExpirationTime(Date expirationTime)
Sets the expiration time for the object.void
setExpirationTimeRuleId(String expirationTimeRuleId)
Sets theBucketLifecycleConfiguration
rule ID for this object's expirationvoid
setMetadata(ObjectMetadata metadata)
Sets the metadata retrieved as a response toAmazonS3Client.putObject(PutObjectRequest)
operation.void
setRequesterCharged(boolean isRequesterCharged)
Used for conducting this operation from a Requester Pays Bucket.void
setVersionId(String versionId)
Sets the optional version ID of the newly uploaded object.
-
-
-
Method Detail
-
getVersionId
public String getVersionId()
Gets the optional version ID of the newly uploaded object. This field will be set only if object versioning is enabled for the bucket the object was uploaded to.- Specified by:
getVersionId
in interfacecom.amazonaws.services.s3.internal.S3VersionResult
- Returns:
- The optional version ID of the newly uploaded object.
- See Also:
setVersionId(String)
-
setVersionId
public void setVersionId(String versionId)
Sets the optional version ID of the newly uploaded object.- Specified by:
setVersionId
in interfacecom.amazonaws.services.s3.internal.S3VersionResult
- Parameters:
versionId
- The optional version ID of the newly uploaded object.- See Also:
getVersionId()
-
getETag
public String getETag()
Gets the server-side ETag value for the newly created object.- Returns:
- The server-side ETag value for the new object.
- See Also:
setETag(String)
-
setETag
public void setETag(String eTag)
Sets the ETag value for the new object that was created from the associatedputObject
request.- Parameters:
eTag
- The ETag value for the new object.- See Also:
getETag()
-
getExpirationTime
public Date getExpirationTime()
Returns the expiration time for this object, or null if it doesn't expire.- Specified by:
getExpirationTime
in interfacecom.amazonaws.services.s3.internal.ObjectExpirationResult
-
setExpirationTime
public void setExpirationTime(Date expirationTime)
Sets the expiration time for the object.- Specified by:
setExpirationTime
in interfacecom.amazonaws.services.s3.internal.ObjectExpirationResult
- Parameters:
expirationTime
- The expiration time for the object.
-
getExpirationTimeRuleId
public String getExpirationTimeRuleId()
Returns theBucketLifecycleConfiguration
rule ID for this object's expiration, or null if it doesn't expire.- Specified by:
getExpirationTimeRuleId
in interfacecom.amazonaws.services.s3.internal.ObjectExpirationResult
- See Also:
BucketLifecycleConfiguration.Rule.getId()
-
setExpirationTimeRuleId
public void setExpirationTimeRuleId(String expirationTimeRuleId)
Sets theBucketLifecycleConfiguration
rule ID for this object's expiration- Specified by:
setExpirationTimeRuleId
in interfacecom.amazonaws.services.s3.internal.ObjectExpirationResult
- Parameters:
expirationTimeRuleId
- The rule ID for this object's expiration
-
setContentMd5
public void setContentMd5(String contentMd5)
Sets the Base64-encoded MD5 hash of the object content that was calculated on the client-side.- Parameters:
contentMd5
- The content MD5
-
getContentMd5
public String getContentMd5()
Returns the Base64-encoded MD5 hash of the object content that was calculated on the client-side. This method returns null if the MD5 validation is disabled and the caller didn't provide the MD5 hash in the ObjectMetadata when sending the PutObjectRequest.
-
getMetadata
public ObjectMetadata getMetadata()
Returns the metadata retrieved as a response toAmazonS3Client.putObject(PutObjectRequest)
operation.
-
setMetadata
public void setMetadata(ObjectMetadata metadata)
Sets the metadata retrieved as a response toAmazonS3Client.putObject(PutObjectRequest)
operation.
-
isRequesterCharged
public boolean isRequesterCharged()
Description copied from interface:com.amazonaws.services.s3.internal.S3RequesterChargedResult
Returns true if the user has enabled Requester Pays option when conducting this operation from Requester Pays Bucket; else false.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
- Specified by:
isRequesterCharged
in interfacecom.amazonaws.services.s3.internal.S3RequesterChargedResult
- Returns:
- true if the user has enabled Requester Pays option for conducting this operation from Requester Pays Bucket.
-
setRequesterCharged
public void setRequesterCharged(boolean isRequesterCharged)
Description copied from interface:com.amazonaws.services.s3.internal.S3RequesterChargedResult
Used for conducting this operation from a Requester Pays Bucket. If set the requester is charged for conducting the operation from the bucket.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.
- Specified by:
setRequesterCharged
in interfacecom.amazonaws.services.s3.internal.S3RequesterChargedResult
- Parameters:
isRequesterCharged
- Indicates requester is charged for this operation.
-
-