Create a directory-like object with empty contents. Successful if already exists.
| 2366 | |
| 2367 | // Create a directory-like object with empty contents. Successful if already exists. |
| 2368 | Status CreateEmptyDir(const std::string& bucket, std::string_view key_view) { |
| 2369 | ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); |
| 2370 | |
| 2371 | auto key = internal::EnsureTrailingSlash(key_view); |
| 2372 | S3Model::PutObjectRequest req; |
| 2373 | req.SetBucket(ToAwsString(bucket)); |
| 2374 | req.SetKey(ToAwsString(key)); |
| 2375 | req.SetContentType(kAwsDirectoryContentType); |
| 2376 | return OutcomeToStatus( |
| 2377 | std::forward_as_tuple("When creating key '", key, "' in bucket '", bucket, "': "), |
| 2378 | "PutObject", client_lock.Move()->PutObject(req)); |
| 2379 | } |
| 2380 | |
| 2381 | Status DeleteObject(const std::string& bucket, const std::string& key) { |
| 2382 | ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); |
no test coverage detected