| 2331 | } |
| 2332 | |
| 2333 | Status CopyObject(const S3Path& src_path, const S3Path& dest_path) { |
| 2334 | ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); |
| 2335 | |
| 2336 | S3Model::CopyObjectRequest req; |
| 2337 | req.SetBucket(ToAwsString(dest_path.bucket)); |
| 2338 | req.SetKey(ToAwsString(dest_path.key)); |
| 2339 | ARROW_ASSIGN_OR_RAISE(auto maybe_sse_headers, |
| 2340 | internal::GetSSECustomerKeyHeaders(options().sse_customer_key)); |
| 2341 | if (maybe_sse_headers.has_value()) { |
| 2342 | auto sse_headers = std::move(maybe_sse_headers).value(); |
| 2343 | req.SetSSECustomerKey(sse_headers.sse_customer_key); |
| 2344 | req.SetSSECustomerKeyMD5(sse_headers.sse_customer_key_md5); |
| 2345 | req.SetSSECustomerAlgorithm(sse_headers.sse_customer_algorithm); |
| 2346 | req.SetCopySourceSSECustomerKey(sse_headers.sse_customer_key); |
| 2347 | req.SetCopySourceSSECustomerKeyMD5(sse_headers.sse_customer_key_md5); |
| 2348 | req.SetCopySourceSSECustomerAlgorithm(sse_headers.sse_customer_algorithm); |
| 2349 | } |
| 2350 | req.SetCopySource(src_path.ToAwsString()); |
| 2351 | return OutcomeToStatus( |
| 2352 | std::forward_as_tuple("When copying key '", src_path.key, "' in bucket '", |
| 2353 | src_path.bucket, "' to key '", dest_path.key, |
| 2354 | "' in bucket '", dest_path.bucket, "': "), |
| 2355 | "CopyObject", client_lock.Move()->CopyObject(req)); |
| 2356 | } |
| 2357 | |
| 2358 | // On Minio, an empty "directory" doesn't satisfy the same API requests as |
| 2359 | // a non-empty "directory". This is a Minio-specific quirk, but we need |
no test coverage detected