Exemple #1
0
 public PathInfo GetDirectoryName(PathInfo filePath)
 {
     return(PathInfo.Create(System.IO.Path.GetDirectoryName(filePath.ToString())));
 }
Exemple #2
0
 public void CreateDirectory(PathInfo directory)
 {
     throw new NotSupportedException();
 }
Exemple #3
0
 public Task <IDisposable> SubscribeDirectoryGetFilesAsync(PathInfo prefix, string extension, Action <IEnumerable <IFileInfo> > handler)
 {
     throw new NotImplementedException();
 }
Exemple #4
0
 public bool DirectoryExists(PathInfo directory)
 {
     return(_names.ContainsKey(directory));
 }
Exemple #5
0
 public bool FileExists(PathInfo filePath)
 {
     return(_names.ContainsKey(filePath));
 }
Exemple #6
0
 public bool IsMatch(PathInfo path)
 {
     return(path.StartsWith(_prefix) && (path.HasExtension(_extension) || string.IsNullOrEmpty(_extension)));
 }
Exemple #7
0
 public EmbeddedFileInfo(PathInfo filePath, string etag)
 {
     FilePath = filePath;
     Etag     = etag;
 }
Exemple #8
0
 public bool DirectoryExists(PathInfo directory)
 {
     return(_directoryInfo.Contains(directory));
 }
Exemple #9
0
 public Stream OpenReadOrCreate(PathInfo filePath)
 {
     return(new FileStream(GetRootPath(filePath).ToString(), FileMode.OpenOrCreate, FileAccess.Read));
 }
Exemple #10
0
        public bool FileExists(PathInfo filePath)
        {
            var dir = _file.GetEntry(GetFullPath(filePath).ToString());

            return(dir != null);
        }
Exemple #11
0
 public IFileInfo GetFileInfo(PathInfo filePath)
 {
     return(new ZipFileInfo(filePath, _etag));
 }
Exemple #12
0
        public Stream OpenRead(PathInfo filePath)
        {
            var file = _file.GetEntry(GetFullPath(filePath).ToString());

            return(_file.GetInputStream(file));
        }
Exemple #13
0
 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))));
 }
Exemple #14
0
        public bool DirectoryExists(PathInfo directory)
        {
            var entryName = GetFullPath(directory);

            return(_file.OfType <ZipEntry>().Any(e => e.Name.StartsWith(entryName)));
        }
Exemple #15
0
 public PathInfo GetFileNameWithoutExtension(PathInfo path)
 {
     return(PathInfo.Create(System.IO.Path.GetFileNameWithoutExtension(path.ToString())));
 }
Exemple #16
0
        public IFileInfo GetFileInfo(PathInfo filePath)
        {
            FileInfo result;

            return(_fileInfoCache.TryGetValue(GetRootPath(filePath), out result) ? result : null);
        }
Exemple #17
0
 public string GetExtension(PathInfo path)
 {
     return(System.IO.Path.GetExtension(path.ToString()));
 }
Exemple #18
0
 public bool FileExists(PathInfo filePath)
 {
     return(_fileInfo.Contains(filePath));
 }
Exemple #19
0
 private FileInfo(PathInfo filePath, System.IO.FileInfo fileInfo)
 {
     FilePath = filePath;
     Etag     = fileInfo.LastWriteTimeUtc.Ticks.ToString("X8");
 }
Exemple #20
0
 public void RemoveFile(PathInfo filePath)
 {
     File.Delete(GetRootPath(filePath).ToString());
 }
Exemple #21
0
 public EmbeddedResourceFileSystem(Assembly assembly)
 {
     _assembly = assembly;
     _names    = _assembly.GetManifestResourceNames().ToDictionary(s => Path.Combine(PathInfo.Create(s)), s => s);
     _etag     = _assembly.GetName().Version.ToString(4);
 }
Exemple #22
0
 public void CreateDirectory(PathInfo directory)
 {
     Directory.CreateDirectory(GetRootPath(directory).ToString());
 }
Exemple #23
0
 public IEnumerable <PathInfo> DirectoryGetFiles(PathInfo directory, string fileExtension)
 {
     throw new NotSupportedException();
 }
Exemple #24
0
 public PathInfo Combine(params PathInfo[] parts)
 {
     return(PathInfo.Combine(parts));
 }
Exemple #25
0
 public void RemoveFile(PathInfo filePath)
 {
     throw new NotSupportedException();
 }
Exemple #26
0
 public PathInfo GetDirectoryName(PathInfo filePath)
 {
     return(filePath.DirectoryName);
 }
Exemple #27
0
 public Stream OpenReadOrCreate(PathInfo filePath)
 {
     throw new NotSupportedException();
 }
Exemple #28
0
 public PathInfo ChangeExtension(PathInfo fileName, string extension)
 {
     return(PathInfo.Create(System.IO.Path.ChangeExtension(fileName.ToString(), extension)));
 }
Exemple #29
0
 public IFileInfo GetFileInfo(PathInfo filePath)
 {
     return(new EmbeddedFileInfo(filePath, _etag));
 }
Exemple #30
0
 public ZipFileInfo(PathInfo filePath, string etag)
 {
     FilePath = filePath;
     Etag     = etag;
 }