| 2390 | } |
| 2391 | |
| 2392 | Status CopyObject(const S3Path& src_path, const S3Path& dest_path) { |
| 2393 | ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); |
| 2394 | |
| 2395 | S3Model::CopyObjectRequest req; |
| 2396 | req.SetBucket(ToAwsString(dest_path.bucket)); |
| 2397 | req.SetKey(ToAwsString(dest_path.key)); |
| 2398 | ARROW_ASSIGN_OR_RAISE(auto maybe_sse_headers, |
| 2399 | internal::GetSSECustomerKeyHeaders(options().sse_customer_key)); |
| 2400 | if (maybe_sse_headers.has_value()) { |
| 2401 | auto sse_headers = std::move(maybe_sse_headers).value(); |
| 2402 | req.SetSSECustomerKey(sse_headers.sse_customer_key); |
| 2403 | req.SetSSECustomerKeyMD5(sse_headers.sse_customer_key_md5); |
| 2404 | req.SetSSECustomerAlgorithm(sse_headers.sse_customer_algorithm); |
| 2405 | req.SetCopySourceSSECustomerKey(sse_headers.sse_customer_key); |
| 2406 | req.SetCopySourceSSECustomerKeyMD5(sse_headers.sse_customer_key_md5); |
| 2407 | req.SetCopySourceSSECustomerAlgorithm(sse_headers.sse_customer_algorithm); |
| 2408 | } |
| 2409 | req.SetCopySource(src_path.ToAwsString()); |
| 2410 | return OutcomeToStatus( |
| 2411 | std::forward_as_tuple("When copying key '", src_path.key, "' in bucket '", |
| 2412 | src_path.bucket, "' to key '", dest_path.key, |
| 2413 | "' in bucket '", dest_path.bucket, "': "), |
| 2414 | "CopyObject", client_lock.Move()->CopyObject(req)); |
| 2415 | } |
| 2416 | |
| 2417 | // On Minio, an empty "directory" doesn't satisfy the same API requests as |
| 2418 | // a non-empty "directory". This is a Minio-specific quirk, but we need |
no test coverage detected