public override StreamWriter OpenWriter(Group group, string extension) { string entryName = pathDeduplicator.GetPath(PathCleaner.Combine(group), extension); Logger.Debug("Creating entry {0} ...", entryName); ZipArchiveEntry entry = archive.CreateEntry(entryName); Stream stream = entry.Open(); return(new StreamWriter(stream)); }
public override StreamWriter OpenWriter(Group group, string extension) { // Get file path. string filePath = Path.Combine(path, PathCleaner.Combine(group)); filePath = pathDeduplicator.GetPath(filePath, extension); Logger.Debug("Opening file: {0} ...", filePath); // Create directory. DirectoryInfo directory = (new FileInfo(filePath)).Directory; if (directory != null && !directory.Exists) { Logger.Debug("Creating directory {0} ...", directory); directory.Create(); } // Return writer. return(new StreamWriter(filePath, false, Encoding.UTF8)); }