Create a directory-like object with empty contents. Successful if already exists.
| 2307 | |
| 2308 | // Create a directory-like object with empty contents. Successful if already exists. |
| 2309 | Status CreateEmptyDir(const std::string& bucket, std::string_view key_view) { |
| 2310 | ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); |
| 2311 | |
| 2312 | auto key = internal::EnsureTrailingSlash(key_view); |
| 2313 | S3Model::PutObjectRequest req; |
| 2314 | req.SetBucket(ToAwsString(bucket)); |
| 2315 | req.SetKey(ToAwsString(key)); |
| 2316 | req.SetContentType(kAwsDirectoryContentType); |
| 2317 | return OutcomeToStatus( |
| 2318 | std::forward_as_tuple("When creating key '", key, "' in bucket '", bucket, "': "), |
| 2319 | "PutObject", client_lock.Move()->PutObject(req)); |
| 2320 | } |
| 2321 | |
| 2322 | Status DeleteObject(const std::string& bucket, const std::string& key) { |
| 2323 | ARROW_ASSIGN_OR_RAISE(auto client_lock, holder_->Lock()); |
no test coverage detected