| 492 | } |
| 493 | |
| 494 | Status CreateDir(const GcsPath& p) { |
| 495 | if (p.object.empty()) { |
| 496 | auto metadata = |
| 497 | gcs::BucketMetadata().set_location(options_.default_bucket_location); |
| 498 | return internal::ToArrowStatus(client_.CreateBucket(p.bucket, metadata).status()); |
| 499 | } |
| 500 | auto parent = p.parent(); |
| 501 | if (!parent.object.empty()) { |
| 502 | auto o = client_.GetObjectMetadata(p.bucket, |
| 503 | internal::EnsureTrailingSlash(parent.object)); |
| 504 | if (!o.ok()) { |
| 505 | return internal::ToArrowStatus(o.status()); |
| 506 | } |
| 507 | if (!IsDirectory(*o)) return NotDirectoryError(*o); |
| 508 | } |
| 509 | return internal::ToArrowStatus(CreateDirMarker(p.bucket, p.object).status()); |
| 510 | } |
| 511 | |
| 512 | Status CreateDirRecursive(const GcsPath& p) { |
| 513 | return CreateDirMarkerRecursive(p.bucket, p.object); |
nothing calls this directly
no test coverage detected