aboutsummaryrefslogtreecommitdiff
path: root/src/file_handler/file_strategies/file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_handler/file_strategies/file.rs')
-rw-r--r--src/file_handler/file_strategies/file.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/file_handler/file_strategies/file.rs b/src/file_handler/file_strategies/file.rs
new file mode 100644
index 0000000..530bbd6
--- /dev/null
+++ b/src/file_handler/file_strategies/file.rs
@@ -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())
+ }
+}