Exemple #1
0
        private void OnExecute()
        {
            var dateClassifier = new DateClassifier();

            if (WorkingDirectory == null)
            {
                WorkingDirectory = Directory.GetCurrentDirectory();
            }
            var storageUtilities = new StorageUtilities();
            var manager          = new StorageManager(dateClassifier, storageUtilities);

            var dateClassifierArgs = new DateClassifierArgs
            {
                Interval               = Interval,
                DirectoryPath          = WorkingDirectory,
                RecursiveMode          = Recursive ? RecursiveMode.RootFolder : RecursiveMode.None,
                UseMultipleClassifiers = UseMultipleClassifiers
            };

            if (MoveToRoot)
            {
                Console.WriteLine("Moving files to root");
                storageUtilities.MoveFilesToRoot(dateClassifierArgs);
                return;
            }
            manager.OrganizeDirectory(dateClassifierArgs);
        }