| 3447 | } |
| 3448 | |
| 3449 | Status AzureFileSystem::DeleteFile(const std::string& path) { |
| 3450 | ARROW_ASSIGN_OR_RAISE(auto location, AzureLocation::FromString(path)); |
| 3451 | if (location.container.empty()) { |
| 3452 | return Status::Invalid("DeleteFile requires a non-empty path."); |
| 3453 | } |
| 3454 | auto container_client = impl_->GetBlobContainerClient(location.container); |
| 3455 | if (location.path.empty()) { |
| 3456 | // Container paths (locations w/o path) are either not found or represent directories. |
| 3457 | ARROW_ASSIGN_OR_RAISE(auto container_info, |
| 3458 | GetContainerPropsAsFileInfo(location, container_client)); |
| 3459 | return container_info.IsDirectory() ? NotAFile(location) : PathNotFound(location); |
| 3460 | } |
| 3461 | auto adlfs_client = impl_->GetFileSystemClient(location.container); |
| 3462 | ARROW_ASSIGN_OR_RAISE(auto hns_support, |
| 3463 | impl_->HierarchicalNamespaceSupport(adlfs_client)); |
| 3464 | if (hns_support == HNSSupport::kContainerNotFound) { |
| 3465 | return PathNotFound(location); |
| 3466 | } |
| 3467 | if (hns_support == HNSSupport::kEnabled) { |
| 3468 | return impl_->DeleteFileOnFileSystem(adlfs_client, location, |
| 3469 | /*require_file_to_exist=*/true); |
| 3470 | } |
| 3471 | return impl_->DeleteFileOnContainer(container_client, location, |
| 3472 | /*require_file_to_exist=*/true, |
| 3473 | /*operation=*/"DeleteFile"); |
| 3474 | } |
| 3475 | |
| 3476 | Status AzureFileSystem::Move(const std::string& src, const std::string& dest) { |
| 3477 | ARROW_ASSIGN_OR_RAISE(auto src_location, AzureLocation::FromString(src)); |
nothing calls this directly
no test coverage detected