You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/11/22 11:52:50 UTC
(incubator-opendal) 23/23: FIx webhdfs
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch fix-stat
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit c0af347a1e8a029f4066f584253544955658b495
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Wed Nov 22 19:52:17 2023 +0800
FIx webhdfs
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
core/src/services/webhdfs/backend.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/core/src/services/webhdfs/backend.rs b/core/src/services/webhdfs/backend.rs
index 9fa9bd150..4a834dc10 100644
--- a/core/src/services/webhdfs/backend.rs
+++ b/core/src/services/webhdfs/backend.rs
@@ -508,6 +508,13 @@ impl Accessor for WebhdfsBackend {
.map_err(new_json_deserialize_error)?
.file_status;
+ if path.ends_with('/') && file_status.ty == FileStatusType::File {
+ return Err(Error::new(
+ ErrorKind::NotFound,
+ "given path is not a directory",
+ ));
+ }
+
let meta = match file_status.ty {
FileStatusType::Directory => Metadata::new(EntryMode::DIR),
FileStatusType::File => Metadata::new(EntryMode::FILE)