From 57944b763f37837161dbec694a6cb2dd1c7d09ef Mon Sep 17 00:00:00 2001 From: Flash <71162630+Young-Flash@users.noreply.github.com> Date: Sun, 13 Aug 2023 11:35:02 +0800 Subject: [PATCH] feat(oay): impl some method for `WebdavMetaData` (#2857) impl some method for `WebdavMetaData` --- bin/oay/src/services/webdav/webdav_metadata.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/oay/src/services/webdav/webdav_metadata.rs b/bin/oay/src/services/webdav/webdav_metadata.rs index 0a564192a26..a473b3d7635 100644 --- a/bin/oay/src/services/webdav/webdav_metadata.rs +++ b/bin/oay/src/services/webdav/webdav_metadata.rs @@ -44,4 +44,18 @@ impl DavMetaData for WebdavMetaData { fn is_dir(&self) -> bool { self.metadata.is_dir() } + + fn is_file(&self) -> bool { + self.metadata.is_file() + } + + fn etag(&self) -> Option { + self.metadata.etag().map(|s| s.to_string()) + } + + fn status_changed(&self) -> dav_server::fs::FsResult { + self.metadata + .last_modified() + .map_or(Err(FsError::GeneralFailure), |t| Ok(t.into())) + } }