private static void ProcessFile(CacheEntryRemovedArguments args) { WriteLine($"* Cache Item removed: {args.CacheItem.Key} because {args.RemovedReason}."); if (args.RemovedReason == CacheEntryRemovedReason.Expired) { var fileProcessor = new FileProcessor(args.CacheItem.Key); fileProcessor.Process(); } else { WriteLine($"WARNING: {args.CacheItem.Key} was removed unexpectedly and may not process."); } }
private static void ProcessDirectory(string directoryPath, string fileType) { switch (fileType) { case "TEXT": string[] textFiles = Directory.GetFiles(directoryPath, "*.txt"); foreach (var textFilePath in textFiles) { var fileProcessor = new FileProcessor(textFilePath); fileProcessor.Process(); } break; default: WriteLine($"ERROR: {fileType} is not supported."); break; } }
private static void ProcessSingleFile(string filePath) { var fileProcessor = new FileProcessor(filePath); fileProcessor.Process(); }