-
-
Notifications
You must be signed in to change notification settings - Fork 379
feat(s3): add copy method to S3Template #1656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -260,6 +260,95 @@ void apply(PutObjectRequest.Builder builder) { | |
| } | ||
| } | ||
|
|
||
| void apply(CopyObjectRequest.Builder builder) { | ||
| builder.metadataDirective(MetadataDirective.REPLACE); | ||
| if (acl != null) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. User ObjectProvider and set to builder instead of many ifs
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Many |
||
| builder.acl(acl); | ||
| } | ||
| if (cacheControl != null) { | ||
| builder.cacheControl(cacheControl); | ||
| } | ||
| if (contentDisposition != null) { | ||
| builder.contentDisposition(contentDisposition); | ||
| } | ||
| if (contentEncoding != null) { | ||
| builder.contentEncoding(contentEncoding); | ||
| } | ||
| if (contentLanguage != null) { | ||
| builder.contentLanguage(contentLanguage); | ||
| } | ||
| if (contentType != null) { | ||
| builder.contentType(contentType); | ||
| } | ||
| if (expires != null) { | ||
| builder.expires(expires); | ||
| } | ||
| if (grantFullControl != null) { | ||
| builder.grantFullControl(grantFullControl); | ||
| } | ||
| if (grantRead != null) { | ||
| builder.grantRead(grantRead); | ||
| } | ||
| if (grantReadACP != null) { | ||
| builder.grantReadACP(grantReadACP); | ||
| } | ||
| if (grantWriteACP != null) { | ||
| builder.grantWriteACP(grantWriteACP); | ||
| } | ||
| if (metadata != null) { | ||
| builder.metadata(metadata); | ||
| } | ||
| if (serverSideEncryption != null) { | ||
| builder.serverSideEncryption(serverSideEncryption); | ||
| } | ||
| if (storageClass != null) { | ||
| builder.storageClass(storageClass); | ||
| } | ||
| if (websiteRedirectLocation != null) { | ||
| builder.websiteRedirectLocation(websiteRedirectLocation); | ||
| } | ||
| if (sseCustomerAlgorithm != null) { | ||
| builder.sseCustomerAlgorithm(sseCustomerAlgorithm); | ||
| } | ||
| if (sseCustomerKey != null) { | ||
| builder.sseCustomerKey(sseCustomerKey); | ||
| } | ||
| if (sseCustomerKeyMD5 != null) { | ||
| builder.sseCustomerKeyMD5(sseCustomerKeyMD5); | ||
| } | ||
| if (ssekmsKeyId != null) { | ||
| builder.ssekmsKeyId(ssekmsKeyId); | ||
| } | ||
| if (ssekmsEncryptionContext != null) { | ||
| builder.ssekmsEncryptionContext(ssekmsEncryptionContext); | ||
| } | ||
| if (bucketKeyEnabled != null) { | ||
| builder.bucketKeyEnabled(bucketKeyEnabled); | ||
| } | ||
| if (requestPayer != null) { | ||
| builder.requestPayer(requestPayer); | ||
| } | ||
| if (tagging != null) { | ||
| builder.taggingDirective(TaggingDirective.REPLACE); | ||
| builder.tagging(tagging); | ||
| } | ||
| if (objectLockMode != null) { | ||
| builder.objectLockMode(objectLockMode); | ||
| } | ||
| if (objectLockRetainUntilDate != null) { | ||
| builder.objectLockRetainUntilDate(objectLockRetainUntilDate); | ||
| } | ||
| if (objectLockLegalHoldStatus != null) { | ||
| builder.objectLockLegalHoldStatus(objectLockLegalHoldStatus); | ||
| } | ||
| if (expectedBucketOwner != null) { | ||
| builder.expectedBucketOwner(expectedBucketOwner); | ||
| } | ||
| if (checksumAlgorithm != null) { | ||
| builder.checksumAlgorithm(checksumAlgorithm); | ||
| } | ||
| } | ||
|
|
||
| void apply(CreateMultipartUploadRequest.Builder builder) { | ||
| if (acl != null) { | ||
| builder.acl(acl); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be configurable as well. Someone might want to override only if no value is set so .COPY