Esempio n. 1
0
 public bool FileExists(PathInfo filePath)
 {
     return(_fileInfo.Contains(filePath));
 }
Esempio n. 2
0
 public void RemoveFile(PathInfo filePath)
 {
     File.Delete(GetRootPath(filePath).ToString());
 }
Esempio n. 3
0
 public ZipFileInfo(PathInfo filePath, string etag)
 {
     FilePath = filePath;
     Etag     = etag;
 }
Esempio n. 4
0
 public Stream OpenReadOrCreate(PathInfo filePath)
 {
     return(new FileStream(GetRootPath(filePath).ToString(), FileMode.OpenOrCreate, FileAccess.Read));
 }
Esempio n. 5
0
 public PathInfo GetFileNameWithoutExtension(PathInfo path)
 {
     return(PathInfo.Create(System.IO.Path.GetFileNameWithoutExtension(path.ToString())));
 }
Esempio n. 6
0
 public bool IsMatch(PathInfo path)
 {
     return(path.StartsWith(_prefix) && (path.HasExtension(_extension) || string.IsNullOrEmpty(_extension)));
 }
Esempio n. 7
0
 public void RemoveFile(PathInfo filePath)
 {
     throw new NotSupportedException();
 }
Esempio n. 8
0
 public PathInfo GetDirectoryName(PathInfo filePath)
 {
     return(filePath.DirectoryName);
 }
Esempio n. 9
0
        public Stream OpenRead(PathInfo filePath)
        {
            var file = _file.GetEntry(GetFullPath(filePath).ToString());

            return(_file.GetInputStream(file));
        }
Esempio n. 10
0
        public bool FileExists(PathInfo filePath)
        {
            var dir = _file.GetEntry(GetFullPath(filePath).ToString());

            return(dir != null);
        }
Esempio n. 11
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))));
 }
Esempio n. 12
0
        public bool DirectoryExists(PathInfo directory)
        {
            var entryName = GetFullPath(directory);

            return(_file.OfType <ZipEntry>().Any(e => e.Name.StartsWith(entryName)));
        }
Esempio n. 13
0
 public PathInfo GetDirectoryName(PathInfo filePath)
 {
     return(PathInfo.Create(System.IO.Path.GetDirectoryName(filePath.ToString())));
 }
Esempio n. 14
0
 public void CreateDirectory(PathInfo directory)
 {
     Directory.CreateDirectory(GetRootPath(directory).ToString());
 }
Esempio n. 15
0
 public Stream OpenReadOrCreate(PathInfo filePath)
 {
     throw new NotSupportedException();
 }
Esempio n. 16
0
 public PathInfo Combine(params PathInfo[] parts)
 {
     return(PathInfo.Combine(parts));
     //return PathInfo.Create(PathUtility.Combine(parts.Select(s => s == null ? null : s.ToString()).ToArray()));
 }
Esempio n. 17
0
 public Task <IDisposable> SubscribeDirectoryGetFilesAsync(PathInfo prefix, string extension, Action <IEnumerable <IFileInfo> > handler)
 {
     throw new NotSupportedException();
 }
Esempio n. 18
0
 public PathInfo ChangeExtension(PathInfo fileName, string extension)
 {
     return(PathInfo.Create(System.IO.Path.ChangeExtension(fileName.ToString(), extension)));
 }
Esempio n. 19
0
 public IFileInfo GetFileInfo(PathInfo filePath)
 {
     return(new ZipFileInfo(filePath, _etag));
 }
Esempio n. 20
0
 public string GetExtension(PathInfo path)
 {
     return(System.IO.Path.GetExtension(path.ToString()));
 }
Esempio n. 21
0
 public bool DirectoryExists(PathInfo directory)
 {
     return(_directoryInfo.Contains(directory));
 }
Esempio n. 22
0
 private FileInfo(PathInfo filePath, System.IO.FileInfo fileInfo)
 {
     FilePath = filePath;
     Etag     = fileInfo.LastWriteTimeUtc.Ticks.ToString("X8");
 }
Esempio n. 23
0
 public void CreateDirectory(PathInfo directory)
 {
     throw new NotSupportedException();
 }