private static FileLoader[] LoadStandardFile(string path, CompressedStorage storage) { var rd = File.OpenText(path); var fileId = storage.AddFile(path); var title = Path.GetFileName(path); return(new[] { new FileLoader(rd, storage, fileId, title) }); }
private static FileLoader[] LoadBzip(string path, CompressedStorage storage) { var uncompressor = new BZip2InputStream(File.OpenRead(path)); var rd = new StreamReader(uncompressor); var fileId = storage.AddFile(path); var title = Path.GetFileName(path); return(new[] { new FileLoader(rd, storage, fileId, title) }); }
private static FileLoader[] LoadZip(string path, CompressedStorage storage) { var zip = new ZipFile(path); var result = new List <FileLoader>(); for (int i = 0; i < zip.Count; i++) { var entry = zip[i]; if (entry.IsFile) { var uncompressor = zip.GetInputStream(i); var rd = new StreamReader(uncompressor); var fileId = storage.AddFile(path); var title = string.Format("{0}:{1}", Path.GetFileNameWithoutExtension(path), zip[i].Name); result.Add(new FileLoader(rd, storage, fileId, title)); } } return(result.ToArray()); }
private static FileLoader[] LoadZip(string path, CompressedStorage storage) { var zip = new ZipFile(path); var result = new List<FileLoader>(); for (int i = 0; i < zip.Count; i++) { var entry = zip[i]; if (entry.IsFile) { var uncompressor = zip.GetInputStream(i); var rd = new StreamReader(uncompressor); var fileId = storage.AddFile(path); var title = string.Format("{0}:{1}", Path.GetFileNameWithoutExtension(path), zip[i].Name); result.Add(new FileLoader(rd, storage, fileId, title)); } } return result.ToArray(); }
private static FileLoader[] LoadBzip(string path, CompressedStorage storage) { var uncompressor = new BZip2InputStream(File.OpenRead(path)); var rd = new StreamReader(uncompressor); var fileId = storage.AddFile(path); var title = Path.GetFileName(path); return new[] { new FileLoader(rd, storage, fileId, title) }; }
private static FileLoader[] LoadStandardFile(string path, CompressedStorage storage) { var rd = File.OpenText(path); var fileId = storage.AddFile(path); var title = Path.GetFileName(path); return new[] {new FileLoader(rd, storage, fileId, title)}; }