file-storage 0.9.0

This library aids in accessing file-like storage.
Documentation
use crate::system::LocalPath;
use crate::Operation::DeleteFiles;
use crate::Reason::UnknownFileSystem;
use crate::{Error, FolderPath};

impl FolderPath {
    //! Delete Files

    /// Deletes all files in the folder recursively.
    pub fn delete_files(&self) -> Result<(), Error> {
        if let Some(path) = LocalPath::new(self.path()) {
            return path.delete_files();
        }

        #[cfg(feature = "r2")]
        if let Some(path) = crate::R2Path::new(self.path()) {
            return path.delete_files();
        }

        Err(Error::new(self.clone(), DeleteFiles, UnknownFileSystem))
    }
}