protected virtual string Save(ImportFile file) { var folder = Path.GetDirectoryName(file.FilePath); if (!string.IsNullOrWhiteSpace(OutputFolder)) { folder = OutputFolder; } var path = Path.Combine(folder, file.Name); var next = ImportFile.Create(path, file.Content); next.Save(); return(path); }
protected virtual ImportFile Load(string filePath) { if (!File.Exists(filePath)) { return(ImportFile.Invalid); } var content = File.ReadAllText(filePath); if (string.IsNullOrWhiteSpace(content)) { return(ImportFile.Empty(filePath)); } return(ImportFile.Create(filePath, content)); }
protected abstract ImportFile Transform(ImportFile file);