Ejemplo n.º 1
0
        private async Task DeleteContents()
        {
            var files          = ScanHelper.GetFiles(SourceDir, keywords: Keywords);
            var subDirectories = ScanHelper.GetSubDirectories(SourceDir, excludeEmpty: ExcludeEmptyDirectories);

            if (Frequency == FrequencyEnum.AfterDays)
            {
                files          = ScanHelper.FilterFilesByAge(DayLimit, files);
                subDirectories = ScanHelper.FilterDirectoriesByAge(DayLimit, subDirectories);
            }

            ScanHelper.DeleteFiles(files);
            ScanHelper.DeleteDirectories(subDirectories);
        }