Xuanwo commented on code in PR #2944:
URL: 
https://github.com/apache/incubator-opendal/pull/2944#discussion_r1306380829


##########
bin/oay/src/services/webdav/webdavfs.rs:
##########
@@ -147,7 +147,10 @@ impl DavFileSystem for WebdavFs {
     fn copy<'a>(&'a self, from: &'a DavPath, to: &'a DavPath) -> 
dav_server::fs::FsFuture<()> {
         async move {
             self.op
-                .copy(&from.as_url_string(), &to.as_url_string())
+                .copy(
+                    from.as_rel_ospath().to_str().unwrap(),

Review Comment:
   Please return error instead of unwrap.



##########
bin/oay/src/services/webdav/webdavfs.rs:
##########
@@ -156,10 +159,24 @@ impl DavFileSystem for WebdavFs {
 
     fn rename<'a>(&'a self, from: &'a DavPath, to: &'a DavPath) -> 
dav_server::fs::FsFuture<()> {
         async move {
-            self.op
-                .rename(from.as_url_string().as_str(), 
to.as_url_string().as_str())
-                .await
-                .map_err(convert_error)
+            let res = self
+                .op
+                .rename(
+                    from.as_rel_ospath().to_str().unwrap(),

Review Comment:
   The same.



##########
bin/oay/src/services/webdav/webdavfs.rs:
##########
@@ -156,10 +159,24 @@ impl DavFileSystem for WebdavFs {
 
     fn rename<'a>(&'a self, from: &'a DavPath, to: &'a DavPath) -> 
dav_server::fs::FsFuture<()> {
         async move {
-            self.op
-                .rename(from.as_url_string().as_str(), 
to.as_url_string().as_str())
-                .await
-                .map_err(convert_error)
+            let res = self
+                .op
+                .rename(
+                    from.as_rel_ospath().to_str().unwrap(),
+                    to.as_rel_ospath().to_str().unwrap(),
+                )
+                .await;
+            match res {
+                Ok(_) => Ok(()),
+                Err(e) => {
+                    if e.kind() == opendal::ErrorKind::Unexpected && 
from.is_collection() {

Review Comment:
   It is unexpected to have a match with `Unexpected`. Can you clarify what 
happened? Perhaps we returned the wrong error kind within OpenDAL.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to