aboutsummaryrefslogtreecommitdiff
path: root/src/file_handler/file_strategies/file.rs
blob: 530bbd6ebd746cecbd6f1f355cbc3f4fe62d31dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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())
    }
}