public void Init(string path) { var outputPath = Path.Combine(path, Constants.OutputFilename); Console.WriteLine($"Writing aggregated sql script to \n{outputPath}"); _outputStream = new FileIOStream(outputPath, FileMode.Create, FileAccess.Write); _fileMerger = new FileMerger(_outputStream); }
public void Process(string file) { var fileName = Path.GetFileName(file); Console.WriteLine(fileName); using (var stream = new FileIOStream(file)) { _fileMerger.Append(stream); } }
public override string[] ExtractFiles(string path) { var sortFileFinder = new SimpleFileExtractor(Constants.FileExecuteOrderFileName); var sortFilePath = sortFileFinder.ExtractFiles(path). ToList().FirstOrDefault(); Console.WriteLine(sortFilePath != null ? $"Sort file found ({sortFilePath})" : "No sort file found"); _sortFileStream = sortFilePath != null ? new FileIOStream(sortFilePath) : null; var sorter = new FileNameSorter(_sortFileStream, Constants.OutputFilename); var extractor = new SimpleFileExtractor(DefaultPattern); var files = extractor.ExtractFiles(path); return(sorter.SortFiles(files)); }