Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void Process(string file)
        {
            var fileName = Path.GetFileName(file);

            Console.WriteLine(fileName);
            using (var stream = new FileIOStream(file))
            {
                _fileMerger.Append(stream);
            }
        }
Esempio n. 3
0
        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));
        }