]> git.r.bdr.sh - rbdr/page/blobdiff - src/file_handler/file_strategies/file.rs
Read the files
[rbdr/page] / src / file_handler / file_strategies / file.rs
diff --git a/src/file_handler/file_strategies/file.rs b/src/file_handler/file_strategies/file.rs
new file mode 100644 (file)
index 0000000..530bbd6
--- /dev/null
@@ -0,0 +1,23 @@
+pub struct Strategy {}
+
+use std::path::PathBuf;
+
+use crate::file_handler::{FileType, FileHandlerStrategy};
+
+impl FileHandlerStrategy for Strategy {
+    fn is(&self, path: &PathBuf) -> bool {
+        !path.is_dir()
+    }
+
+    fn identify(&self) -> FileType {
+        FileType::File
+    }
+
+    fn can_handle(&self, path: &PathBuf) -> bool {
+        !path.is_dir()
+    }
+
+    fn handle(&self, path: &PathBuf) {
+        println!("Should copy {}", path.display())
+    }
+}