| 3392 | } |
| 3393 | |
| 3394 | Status AzureFileSystem::DeleteDir(const std::string& path) { |
| 3395 | ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path)); |
| 3396 | if (location.container.empty()) { |
| 3397 | return Status::Invalid("DeleteDir requires a non-empty path."); |
| 3398 | } |
| 3399 | if (location.path.empty()) { |
| 3400 | auto container_client = impl_->GetBlobContainerClient(location.container); |
| 3401 | return impl_->DeleteContainer(container_client, location); |
| 3402 | } |
| 3403 | |
| 3404 | auto adlfs_client = impl_->GetFileSystemClient(location.container); |
| 3405 | ARROW_ASSIGN_OR_RAISE(auto hns_support, |
| 3406 | impl_->HierarchicalNamespaceSupport(adlfs_client)); |
| 3407 | if (hns_support == HNSSupport::kContainerNotFound) { |
| 3408 | return PathNotFound(location); |
| 3409 | } |
| 3410 | if (hns_support == HNSSupport::kEnabled) { |
| 3411 | return impl_->DeleteDirOnFileSystem(adlfs_client, location, /*recursive=*/true, |
| 3412 | /*require_dir_to_exist=*/true); |
| 3413 | } |
| 3414 | DCHECK_EQ(hns_support, HNSSupport::kDisabled); |
| 3415 | auto container_client = impl_->GetBlobContainerClient(location.container); |
| 3416 | return impl_->DeleteDirContentsOnContainer(container_client, location, |
| 3417 | /*require_dir_to_exist=*/true, |
| 3418 | /*preserve_dir_marker_blob=*/false, |
| 3419 | "DeleteDir"); |
| 3420 | } |
| 3421 | |
| 3422 | Status AzureFileSystem::DeleteDirContents(const std::string& path, bool missing_dir_ok) { |
| 3423 | ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path)); |
nothing calls this directly
no test coverage detected