public PathInfo GetDirectoryName(PathInfo filePath) { return(PathInfo.Create(System.IO.Path.GetDirectoryName(filePath.ToString()))); }
public void CreateDirectory(PathInfo directory) { throw new NotSupportedException(); }
public Task <IDisposable> SubscribeDirectoryGetFilesAsync(PathInfo prefix, string extension, Action <IEnumerable <IFileInfo> > handler) { throw new NotImplementedException(); }
public bool DirectoryExists(PathInfo directory) { return(_names.ContainsKey(directory)); }
public bool FileExists(PathInfo filePath) { return(_names.ContainsKey(filePath)); }
public bool IsMatch(PathInfo path) { return(path.StartsWith(_prefix) && (path.HasExtension(_extension) || string.IsNullOrEmpty(_extension))); }
public EmbeddedFileInfo(PathInfo filePath, string etag) { FilePath = filePath; Etag = etag; }
public bool DirectoryExists(PathInfo directory) { return(_directoryInfo.Contains(directory)); }
public Stream OpenReadOrCreate(PathInfo filePath) { return(new FileStream(GetRootPath(filePath).ToString(), FileMode.OpenOrCreate, FileAccess.Read)); }
public bool FileExists(PathInfo filePath) { var dir = _file.GetEntry(GetFullPath(filePath).ToString()); return(dir != null); }
public IFileInfo GetFileInfo(PathInfo filePath) { return(new ZipFileInfo(filePath, _etag)); }
public Stream OpenRead(PathInfo filePath) { var file = _file.GetEntry(GetFullPath(filePath).ToString()); return(_file.GetInputStream(file)); }
public IEnumerable <PathInfo> DirectoryGetFiles(PathInfo directory, string fileExtension) { return(_file.OfType <ZipEntry>() .Where(e => e.IsFile && e.Name.StartsWith(GetFullPath(directory)) && e.Name.EndsWith(string.Concat(".", fileExtension))) .Select(e => PathInfo.Create(e.Name.Substring(_rootPathLength + 1)))); }
public bool DirectoryExists(PathInfo directory) { var entryName = GetFullPath(directory); return(_file.OfType <ZipEntry>().Any(e => e.Name.StartsWith(entryName))); }
public PathInfo GetFileNameWithoutExtension(PathInfo path) { return(PathInfo.Create(System.IO.Path.GetFileNameWithoutExtension(path.ToString()))); }
public IFileInfo GetFileInfo(PathInfo filePath) { FileInfo result; return(_fileInfoCache.TryGetValue(GetRootPath(filePath), out result) ? result : null); }
public string GetExtension(PathInfo path) { return(System.IO.Path.GetExtension(path.ToString())); }
public bool FileExists(PathInfo filePath) { return(_fileInfo.Contains(filePath)); }
private FileInfo(PathInfo filePath, System.IO.FileInfo fileInfo) { FilePath = filePath; Etag = fileInfo.LastWriteTimeUtc.Ticks.ToString("X8"); }
public void RemoveFile(PathInfo filePath) { File.Delete(GetRootPath(filePath).ToString()); }
public EmbeddedResourceFileSystem(Assembly assembly) { _assembly = assembly; _names = _assembly.GetManifestResourceNames().ToDictionary(s => Path.Combine(PathInfo.Create(s)), s => s); _etag = _assembly.GetName().Version.ToString(4); }
public void CreateDirectory(PathInfo directory) { Directory.CreateDirectory(GetRootPath(directory).ToString()); }
public IEnumerable <PathInfo> DirectoryGetFiles(PathInfo directory, string fileExtension) { throw new NotSupportedException(); }
public PathInfo Combine(params PathInfo[] parts) { return(PathInfo.Combine(parts)); }
public void RemoveFile(PathInfo filePath) { throw new NotSupportedException(); }
public PathInfo GetDirectoryName(PathInfo filePath) { return(filePath.DirectoryName); }
public Stream OpenReadOrCreate(PathInfo filePath) { throw new NotSupportedException(); }
public PathInfo ChangeExtension(PathInfo fileName, string extension) { return(PathInfo.Create(System.IO.Path.ChangeExtension(fileName.ToString(), extension))); }
public IFileInfo GetFileInfo(PathInfo filePath) { return(new EmbeddedFileInfo(filePath, _etag)); }
public ZipFileInfo(PathInfo filePath, string etag) { FilePath = filePath; Etag = etag; }