Skip to content

Commit

Permalink
feat(oay): impl some method for WebdavMetaData (#2857)
Browse files Browse the repository at this point in the history
impl some method for `WebdavMetaData`
  • Loading branch information
Young-Flash authored Aug 13, 2023
1 parent 62d376a commit 57944b7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bin/oay/src/services/webdav/webdav_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
self.metadata.etag().map(|s| s.to_string())
}

fn status_changed(&self) -> dav_server::fs::FsResult<std::time::SystemTime> {
self.metadata
.last_modified()
.map_or(Err(FsError::GeneralFailure), |t| Ok(t.into()))
}
}

0 comments on commit 57944b7

Please sign in to comment.