Class S3CopyObjectOperation
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<S3CopyObjectOperation.Builder,S3CopyObjectOperation>
Contains the configuration parameters for a PUT Copy object operation. S3 Batch Operations passes every object to the
underlying CopyObject API operation. For more information about the parameters for this operation, see
CopyObject.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanSpecifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS).builder()final Stringfinal S3ChecksumAlgorithmIndicates the algorithm that you want Amazon S3 to use to create the checksum.final StringIndicates the algorithm that you want Amazon S3 to use to create the checksum.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final booleanFor responses, this returns true if the service returned a value for the AccessControlGrants property.final inthashCode()final booleanFor responses, this returns true if the service returned a value for the NewObjectTagging property.final S3MetadataDirectivefinal Stringfinal Instantfinal S3ObjectMetadataIf you don't provide this parameter, Amazon S3 copies all the metadata from the original objects.Specifies a list of tags to add to the destination objects after they are copied.The legal hold status to be applied to all objects in the Batch Operations job.final StringThe legal hold status to be applied to all objects in the Batch Operations job.final S3ObjectLockModeThe retention mode to be applied to all objects in the Batch Operations job.final StringThe retention mode to be applied to all objects in the Batch Operations job.final InstantThe date when the applied object retention configuration expires on all objects in the Batch Operations job.final StringIf the destination bucket is configured as a website, specifies an optional metadata property for website redirects,x-amz-website-redirect-location.final Booleanstatic Class<? extends S3CopyObjectOperation.Builder> final StringSpecifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption.final S3StorageClassSpecify the storage class for the destination objects in aCopyoperation.final StringSpecify the storage class for the destination objects in aCopyoperation.final StringSpecifies the folder prefix that you want the objects to be copied into.final StringSpecifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.final InstantMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
targetResource
Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.
-
General purpose buckets - For example, to copy objects to a general purpose bucket named
destinationBucket, set theTargetResourceproperty toarn:aws:s3:::destinationBucket. -
Directory buckets - For example, to copy objects to a directory bucket named
destinationBucketin the Availability Zone identified by the AZ IDusw2-az1, set theTargetResourceproperty toarn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az1--x-s3. A directory bucket as a destination bucket can be in Availability Zone or Local Zone.Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP
400 Bad Requesterror with the error codeInvalidRequest.
- Returns:
- Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.
-
General purpose buckets - For example, to copy objects to a general purpose bucket named
destinationBucket, set theTargetResourceproperty toarn:aws:s3:::destinationBucket. -
Directory buckets - For example, to copy objects to a directory bucket named
destinationBucketin the Availability Zone identified by the AZ IDusw2-az1, set theTargetResourceproperty toarn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az1--x-s3. A directory bucket as a destination bucket can be in Availability Zone or Local Zone.Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP
400 Bad Requesterror with the error codeInvalidRequest.
-
-
-
cannedAccessControlList
This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
cannedAccessControlListwill returnS3CannedAccessControlList.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcannedAccessControlListAsString().- Returns:
This functionality is not supported by directory buckets.
- See Also:
-
cannedAccessControlListAsString
This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
cannedAccessControlListwill returnS3CannedAccessControlList.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcannedAccessControlListAsString().- Returns:
This functionality is not supported by directory buckets.
- See Also:
-
hasAccessControlGrants
public final boolean hasAccessControlGrants()For responses, this returns true if the service returned a value for the AccessControlGrants property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
accessControlGrants
This functionality is not supported by directory buckets.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasAccessControlGrants()method.- Returns:
This functionality is not supported by directory buckets.
-
metadataDirective
If the service returns an enum value that is not available in the current SDK version,
metadataDirectivewill returnS3MetadataDirective.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frommetadataDirectiveAsString().- Returns:
- See Also:
-
metadataDirectiveAsString
If the service returns an enum value that is not available in the current SDK version,
metadataDirectivewill returnS3MetadataDirective.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frommetadataDirectiveAsString().- Returns:
- See Also:
-
modifiedSinceConstraint
-
newObjectMetadata
If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.
- Returns:
- If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.
-
hasNewObjectTagging
public final boolean hasNewObjectTagging()For responses, this returns true if the service returned a value for the NewObjectTagging property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
newObjectTagging
Specifies a list of tags to add to the destination objects after they are copied. If
NewObjectTaggingis not specified, the tags of the source objects are copied to destination objects by default.Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the
NewObjectTaggingfield to prevent copying the source object tags to the directory bucket.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasNewObjectTagging()method.- Returns:
- Specifies a list of tags to add to the destination objects after they are copied. If
NewObjectTaggingis not specified, the tags of the source objects are copied to destination objects by default.Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the
NewObjectTaggingfield to prevent copying the source object tags to the directory bucket.
-
redirectLocation
If the destination bucket is configured as a website, specifies an optional metadata property for website redirects,
x-amz-website-redirect-location. Allows webpage redirects if the object copy is accessed through a website endpoint.This functionality is not supported by directory buckets.
- Returns:
- If the destination bucket is configured as a website, specifies an optional metadata property for website
redirects,
x-amz-website-redirect-location. Allows webpage redirects if the object copy is accessed through a website endpoint.This functionality is not supported by directory buckets.
-
requesterPays
This functionality is not supported by directory buckets.
- Returns:
This functionality is not supported by directory buckets.
-
storageClass
Specify the storage class for the destination objects in a
Copyoperation.Directory buckets - This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
storageClasswill returnS3StorageClass.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromstorageClassAsString().- Returns:
- Specify the storage class for the destination objects in a
Copyoperation.Directory buckets - This functionality is not supported by directory buckets.
- See Also:
-
storageClassAsString
Specify the storage class for the destination objects in a
Copyoperation.Directory buckets - This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
storageClasswill returnS3StorageClass.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromstorageClassAsString().- Returns:
- Specify the storage class for the destination objects in a
Copyoperation.Directory buckets - This functionality is not supported by directory buckets.
- See Also:
-
unModifiedSinceConstraint
-
sseAwsKmsKeyId
Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.
Directory buckets - If you specify
SSEAlgorithmwithKMS, you must specify theSSEAwsKmsKeyIdparameter with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP400 Bad Requesterror. The key alias format of the KMS key isn't supported. To encrypt new object copies in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS as the bucket default encryption, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you specify server-side encryption settings for new object copies with SSE-KMS, you must make sure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.- Returns:
- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key
doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key
ID.
Directory buckets - If you specify
SSEAlgorithmwithKMS, you must specify theSSEAwsKmsKeyIdparameter with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP400 Bad Requesterror. The key alias format of the KMS key isn't supported. To encrypt new object copies in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS as the bucket default encryption, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you specify server-side encryption settings for new object copies with SSE-KMS, you must make sure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.
-
targetKeyPrefix
Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named
Folder1in the destination bucket, set theTargetKeyPrefixproperty toFolder1.- Returns:
- Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects
into a folder named
Folder1in the destination bucket, set theTargetKeyPrefixproperty toFolder1.
-
objectLockLegalHoldStatus
The legal hold status to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
objectLockLegalHoldStatuswill returnS3ObjectLockLegalHoldStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromobjectLockLegalHoldStatusAsString().- Returns:
- The legal hold status to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
- See Also:
-
objectLockLegalHoldStatusAsString
The legal hold status to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
objectLockLegalHoldStatuswill returnS3ObjectLockLegalHoldStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromobjectLockLegalHoldStatusAsString().- Returns:
- The legal hold status to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
- See Also:
-
objectLockMode
The retention mode to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
objectLockModewill returnS3ObjectLockMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromobjectLockModeAsString().- Returns:
- The retention mode to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
- See Also:
-
objectLockModeAsString
The retention mode to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
If the service returns an enum value that is not available in the current SDK version,
objectLockModewill returnS3ObjectLockMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromobjectLockModeAsString().- Returns:
- The retention mode to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
- See Also:
-
objectLockRetainUntilDate
The date when the applied object retention configuration expires on all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
- Returns:
- The date when the applied object retention configuration expires on all objects in the Batch Operations
job.
This functionality is not supported by directory buckets.
-
bucketKeyEnabled
Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to
truecauses Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.Specifying this header with an Copy action doesn’t affect bucket-level settings for S3 Bucket Key.
Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through the Copy operation in Batch Operations. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.
- Returns:
- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption
using Amazon Web Services KMS (SSE-KMS). Setting this header to
truecauses Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.Specifying this header with an Copy action doesn’t affect bucket-level settings for S3 Bucket Key.
Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through the Copy operation in Batch Operations. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.
-
checksumAlgorithm
Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
If the service returns an enum value that is not available in the current SDK version,
checksumAlgorithmwill returnS3ChecksumAlgorithm.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromchecksumAlgorithmAsString().- Returns:
- Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
- See Also:
-
checksumAlgorithmAsString
Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
If the service returns an enum value that is not available in the current SDK version,
checksumAlgorithmwill returnS3ChecksumAlgorithm.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromchecksumAlgorithmAsString().- Returns:
- Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
- See Also:
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<S3CopyObjectOperation.Builder,S3CopyObjectOperation> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-