@Generated(value="software.amazon.awssdk:codegen") public final class CopyObjectRequest extends S3Request implements ToCopyableBuilder<CopyObjectRequest.Builder,CopyObjectRequest>
Modifier and Type | Class and Description |
---|---|
static interface |
CopyObjectRequest.Builder |
Modifier and Type | Method and Description |
---|---|
ObjectCannedACL |
acl()
The canned ACL to apply to the object.
|
String |
aclAsString()
The canned ACL to apply to the object.
|
String |
bucket()
Deprecated.
|
Boolean |
bucketKeyEnabled()
Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using
AWS KMS (SSE-KMS).
|
static CopyObjectRequest.Builder |
builder() |
String |
cacheControl()
Specifies caching behavior along the request/reply chain.
|
String |
contentDisposition()
Specifies presentational information for the object.
|
String |
contentEncoding()
Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be
applied to obtain the media-type referenced by the Content-Type header field.
|
String |
contentLanguage()
The language the content is in.
|
String |
contentType()
A standard MIME type describing the format of the object data.
|
String |
copySource()
Specifies the source object for the copy operation.
|
String |
copySourceIfMatch()
Copies the object if its entity tag (ETag) matches the specified tag.
|
Instant |
copySourceIfModifiedSince()
Copies the object if it has been modified since the specified time.
|
String |
copySourceIfNoneMatch()
Copies the object if its entity tag (ETag) is different than the specified ETag.
|
Instant |
copySourceIfUnmodifiedSince()
Copies the object if it hasn't been modified since the specified time.
|
String |
copySourceSSECustomerAlgorithm()
Specifies the algorithm to use when decrypting the source object (for example, AES256).
|
String |
copySourceSSECustomerKey()
Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object.
|
String |
copySourceSSECustomerKeyMD5()
Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321.
|
String |
destinationBucket()
The name of the destination bucket.
|
String |
destinationKey()
The key of the destination object.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
String |
expectedBucketOwner()
The account id of the expected destination bucket owner.
|
String |
expectedSourceBucketOwner()
The account id of the expected source bucket owner.
|
Instant |
expires()
The date and time at which the object is no longer cacheable.
|
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
String |
grantFullControl()
Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
|
String |
grantRead()
Allows grantee to read the object data and its metadata.
|
String |
grantReadACP()
Allows grantee to read the object ACL.
|
String |
grantWriteACP()
Allows grantee to write the ACL for the applicable object.
|
int |
hashCode() |
boolean |
hasMetadata()
Returns true if the Metadata property was specified by the sender (it may be empty), or false if the sender did
not specify the value (it will be empty).
|
String |
key()
Deprecated.
Use
destinationKey() |
Map<String,String> |
metadata()
A map of metadata to store with the object in S3.
|
MetadataDirective |
metadataDirective()
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the
request.
|
String |
metadataDirectiveAsString()
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the
request.
|
ObjectLockLegalHoldStatus |
objectLockLegalHoldStatus()
Specifies whether you want to apply a Legal Hold to the copied object.
|
String |
objectLockLegalHoldStatusAsString()
Specifies whether you want to apply a Legal Hold to the copied object.
|
ObjectLockMode |
objectLockMode()
The Object Lock mode that you want to apply to the copied object.
|
String |
objectLockModeAsString()
The Object Lock mode that you want to apply to the copied object.
|
Instant |
objectLockRetainUntilDate()
The date and time when you want the copied object's Object Lock to expire.
|
RequestPayer |
requestPayer()
Returns the value of the RequestPayer property for this object.
|
String |
requestPayerAsString()
Returns the value of the RequestPayer property for this object.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends CopyObjectRequest.Builder> |
serializableBuilderClass() |
ServerSideEncryption |
serverSideEncryption()
The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
|
String |
serverSideEncryptionAsString()
The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
|
String |
sseCustomerAlgorithm()
Specifies the algorithm to use to when encrypting the object (for example, AES256).
|
String |
sseCustomerKey()
Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data.
|
String |
sseCustomerKeyMD5()
Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321.
|
String |
ssekmsEncryptionContext()
Specifies the AWS KMS Encryption Context to use for object encryption.
|
String |
ssekmsKeyId()
Specifies the AWS KMS key ID to use for object encryption.
|
StorageClass |
storageClass()
By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects.
|
String |
storageClassAsString()
By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects.
|
String |
tagging()
The tag-set for the object destination object this value must be used in conjunction with the
TaggingDirective . |
TaggingDirective |
taggingDirective()
Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in the
request.
|
String |
taggingDirectiveAsString()
Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in the
request.
|
CopyObjectRequest.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
String |
websiteRedirectLocation()
If the bucket is configured as a website, redirects requests for this object to another object in the same bucket
or to an external URL.
|
overrideConfiguration
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
copy
public final ObjectCannedACL acl()
The canned ACL to apply to the object.
This action is not supported by Amazon S3 on Outposts.
If the service returns an enum value that is not available in the current SDK version, acl
will return
ObjectCannedACL.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
aclAsString()
.
This action is not supported by Amazon S3 on Outposts.
ObjectCannedACL
public final String aclAsString()
The canned ACL to apply to the object.
This action is not supported by Amazon S3 on Outposts.
If the service returns an enum value that is not available in the current SDK version, acl
will return
ObjectCannedACL.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
aclAsString()
.
This action is not supported by Amazon S3 on Outposts.
ObjectCannedACL
public final String cacheControl()
Specifies caching behavior along the request/reply chain.
public final String contentDisposition()
Specifies presentational information for the object.
public final String contentEncoding()
Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
public final String contentLanguage()
The language the content is in.
public final String contentType()
A standard MIME type describing the format of the object data.
public final String copySource()
Specifies the source object for the copy operation. You specify the value in one of two formats, depending on whether you want to access the source object through an access point:
For objects not accessed through an access point, specify the name of the source bucket and the key of the source
object, separated by a slash (/). For example, to copy the object reports/january.pdf
from the
bucket awsexamplebucket
, use awsexamplebucket/reports/january.pdf
. The value must be
URL encoded.
For objects accessed through access points, specify the Amazon Resource Name (ARN) of the object as accessed
through the access point, in the format
arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>
. For example, to copy the object reports/january.pdf
through access point
my-access-point
owned by account 123456789012
in Region us-west-2
, use the
URL encoding of
arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf
. The value
must be URL encoded.
Amazon S3 supports copy operations using access points only when the source and destination buckets are in the same AWS Region.
Alternatively, for objects accessed through Amazon S3 on Outposts, specify the ARN of the object as accessed in
the format
arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>
.
For example, to copy the object reports/january.pdf
through outpost my-outpost
owned by
account 123456789012
in Region us-west-2
, use the URL encoding of
arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf
. The value
must be URL encoded.
To copy a specific version of an object, append ?versionId=<version-id>
to the value (for
example, awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893
). If you
don't specify a version ID, Amazon S3 copies the latest version of the source object.
For objects not accessed through an access point, specify the name of the source bucket and the key of
the source object, separated by a slash (/). For example, to copy the object
reports/january.pdf
from the bucket awsexamplebucket
, use
awsexamplebucket/reports/january.pdf
. The value must be URL encoded.
For objects accessed through access points, specify the Amazon Resource Name (ARN) of the object as
accessed through the access point, in the format
arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>
. For example, to copy the object reports/january.pdf
through access point
my-access-point
owned by account 123456789012
in Region us-west-2
,
use the URL encoding of
arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf
.
The value must be URL encoded.
Amazon S3 supports copy operations using access points only when the source and destination buckets are in the same AWS Region.
Alternatively, for objects accessed through Amazon S3 on Outposts, specify the ARN of the object as
accessed in the format
arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>
. For example, to copy the object reports/january.pdf
through outpost
my-outpost
owned by account 123456789012
in Region us-west-2
, use
the URL encoding of
arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf
.
The value must be URL encoded.
To copy a specific version of an object, append ?versionId=<version-id>
to the value
(for example,
awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893
). If you
don't specify a version ID, Amazon S3 copies the latest version of the source object.
public final String copySourceIfMatch()
Copies the object if its entity tag (ETag) matches the specified tag.
public final Instant copySourceIfModifiedSince()
Copies the object if it has been modified since the specified time.
public final String copySourceIfNoneMatch()
Copies the object if its entity tag (ETag) is different than the specified ETag.
public final Instant copySourceIfUnmodifiedSince()
Copies the object if it hasn't been modified since the specified time.
public final Instant expires()
The date and time at which the object is no longer cacheable.
public final String grantFullControl()
Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
This action is not supported by Amazon S3 on Outposts.
This action is not supported by Amazon S3 on Outposts.
public final String grantRead()
Allows grantee to read the object data and its metadata.
This action is not supported by Amazon S3 on Outposts.
This action is not supported by Amazon S3 on Outposts.
public final String grantReadACP()
Allows grantee to read the object ACL.
This action is not supported by Amazon S3 on Outposts.
This action is not supported by Amazon S3 on Outposts.
public final String grantWriteACP()
Allows grantee to write the ACL for the applicable object.
This action is not supported by Amazon S3 on Outposts.
This action is not supported by Amazon S3 on Outposts.
public final boolean hasMetadata()
public final Map<String,String> metadata()
A map of metadata to store with the object in S3.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
You can use hasMetadata()
to see if a value was sent in this field.
public final MetadataDirective metadataDirective()
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
If the service returns an enum value that is not available in the current SDK version, metadataDirective
will return MetadataDirective.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available
from metadataDirectiveAsString()
.
MetadataDirective
public final String metadataDirectiveAsString()
Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.
If the service returns an enum value that is not available in the current SDK version, metadataDirective
will return MetadataDirective.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available
from metadataDirectiveAsString()
.
MetadataDirective
public final TaggingDirective taggingDirective()
Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in the request.
If the service returns an enum value that is not available in the current SDK version, taggingDirective
will return TaggingDirective.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available
from taggingDirectiveAsString()
.
TaggingDirective
public final String taggingDirectiveAsString()
Specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in the request.
If the service returns an enum value that is not available in the current SDK version, taggingDirective
will return TaggingDirective.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available
from taggingDirectiveAsString()
.
TaggingDirective
public final ServerSideEncryption serverSideEncryption()
The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
If the service returns an enum value that is not available in the current SDK version,
serverSideEncryption
will return ServerSideEncryption.UNKNOWN_TO_SDK_VERSION
. The raw value
returned by the service is available from serverSideEncryptionAsString()
.
ServerSideEncryption
public final String serverSideEncryptionAsString()
The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).
If the service returns an enum value that is not available in the current SDK version,
serverSideEncryption
will return ServerSideEncryption.UNKNOWN_TO_SDK_VERSION
. The raw value
returned by the service is available from serverSideEncryptionAsString()
.
ServerSideEncryption
public final StorageClass storageClass()
By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, see Storage Classes in the Amazon S3 Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version, storageClass
will
return StorageClass.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
storageClassAsString()
.
StorageClass
public final String storageClassAsString()
By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, see Storage Classes in the Amazon S3 Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version, storageClass
will
return StorageClass.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
storageClassAsString()
.
StorageClass
public final String websiteRedirectLocation()
If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
public final String sseCustomerAlgorithm()
Specifies the algorithm to use to when encrypting the object (for example, AES256).
public final String sseCustomerKey()
Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to
store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be
appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithm
header.
x-amz-server-side-encryption-customer-algorithm
header.public final String sseCustomerKeyMD5()
Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
public final String ssekmsKeyId()
Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. For information about configuring using any of the officially supported AWS SDKs and AWS CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 Developer Guide.
public final String ssekmsEncryptionContext()
Specifies the AWS KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
public final Boolean bucketKeyEnabled()
Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using
AWS KMS (SSE-KMS). Setting this header to true
causes Amazon S3 to use an S3 Bucket Key for object
encryption with SSE-KMS.
Specifying this header with a COPY operation doesn’t affect bucket-level settings for S3 Bucket Key.
true
causes Amazon S3 to use an S3 Bucket
Key for object encryption with SSE-KMS.
Specifying this header with a COPY operation doesn’t affect bucket-level settings for S3 Bucket Key.
public final String copySourceSSECustomerAlgorithm()
Specifies the algorithm to use when decrypting the source object (for example, AES256).
public final String copySourceSSECustomerKey()
Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created.
public final String copySourceSSECustomerKeyMD5()
Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
public final RequestPayer requestPayer()
If the service returns an enum value that is not available in the current SDK version, requestPayer
will
return RequestPayer.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
requestPayerAsString()
.
RequestPayer
public final String requestPayerAsString()
If the service returns an enum value that is not available in the current SDK version, requestPayer
will
return RequestPayer.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
requestPayerAsString()
.
RequestPayer
public final String tagging()
The tag-set for the object destination object this value must be used in conjunction with the
TaggingDirective
. The tag-set must be encoded as URL Query parameters.
TaggingDirective
. The tag-set must be encoded as URL Query parameters.public final ObjectLockMode objectLockMode()
The Object Lock mode that you want to apply to the copied object.
If the service returns an enum value that is not available in the current SDK version, objectLockMode
will return ObjectLockMode.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available
from objectLockModeAsString()
.
ObjectLockMode
public final String objectLockModeAsString()
The Object Lock mode that you want to apply to the copied object.
If the service returns an enum value that is not available in the current SDK version, objectLockMode
will return ObjectLockMode.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available
from objectLockModeAsString()
.
ObjectLockMode
public final Instant objectLockRetainUntilDate()
The date and time when you want the copied object's Object Lock to expire.
public final ObjectLockLegalHoldStatus objectLockLegalHoldStatus()
Specifies whether you want to apply a Legal Hold to the copied object.
If the service returns an enum value that is not available in the current SDK version,
objectLockLegalHoldStatus
will return ObjectLockLegalHoldStatus.UNKNOWN_TO_SDK_VERSION
. The raw
value returned by the service is available from objectLockLegalHoldStatusAsString()
.
ObjectLockLegalHoldStatus
public final String objectLockLegalHoldStatusAsString()
Specifies whether you want to apply a Legal Hold to the copied object.
If the service returns an enum value that is not available in the current SDK version,
objectLockLegalHoldStatus
will return ObjectLockLegalHoldStatus.UNKNOWN_TO_SDK_VERSION
. The raw
value returned by the service is available from objectLockLegalHoldStatusAsString()
.
ObjectLockLegalHoldStatus
public final String expectedBucketOwner()
The account id of the expected destination bucket owner. If the destination bucket is owned by a different
account, the request will fail with an HTTP 403 (Access Denied)
error.
403 (Access Denied)
error.public final String expectedSourceBucketOwner()
The account id of the expected source bucket owner. If the source bucket is owned by a different account, the
request will fail with an HTTP 403 (Access Denied)
error.
403 (Access Denied)
error.@Deprecated public final String bucket()
destinationBucket()
The name of the destination bucket.
When using this API with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this operation with an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using Access Points in the Amazon Simple Storage Service Developer Guide.
When using this API with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this operation using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon Simple Storage Service Developer Guide.
When using this API with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this operation with an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using Access Points in the Amazon Simple Storage Service Developer Guide.
When using this API with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this operation using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon Simple Storage Service Developer Guide.
public final String destinationBucket()
The name of the destination bucket.
When using this API with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this operation with an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using Access Points in the Amazon Simple Storage Service Developer Guide.
When using this API with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this operation using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon Simple Storage Service Developer Guide.
When using this API with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this operation with an access point through the AWS SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using Access Points in the Amazon Simple Storage Service Developer Guide.
When using this API with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this operation using S3 on Outposts through the AWS SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon Simple Storage Service Developer Guide.
@Deprecated public final String key()
destinationKey()
The key of the destination object.
public final String destinationKey()
The key of the destination object.
public CopyObjectRequest.Builder toBuilder()
toBuilder
in interface ToCopyableBuilder<CopyObjectRequest.Builder,CopyObjectRequest>
toBuilder
in class S3Request
public static CopyObjectRequest.Builder builder()
public static Class<? extends CopyObjectRequest.Builder> serializableBuilderClass()
public final int hashCode()
hashCode
in class AwsRequest
public final boolean equals(Object obj)
equals
in class AwsRequest
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields
in interface SdkPojo
public final String toString()
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
getValueForField
in class SdkRequest
Copyright © 2020. All rights reserved.