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

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

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

            return(_file.OfType <ZipEntry>().Any(e => e.Name.StartsWith(entryName)));
        }
示例#13
0
 public PathInfo GetDirectoryName(PathInfo filePath)
 {
     return(PathInfo.Create(System.IO.Path.GetDirectoryName(filePath.ToString())));
 }
示例#14
0
 public void CreateDirectory(PathInfo directory)
 {
     Directory.CreateDirectory(GetRootPath(directory).ToString());
 }
示例#15
0
 public Stream OpenReadOrCreate(PathInfo filePath)
 {
     throw new NotSupportedException();
 }
示例#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()));
 }
示例#17
0
 public Task <IDisposable> SubscribeDirectoryGetFilesAsync(PathInfo prefix, string extension, Action <IEnumerable <IFileInfo> > handler)
 {
     throw new NotSupportedException();
 }
示例#18
0
 public PathInfo ChangeExtension(PathInfo fileName, string extension)
 {
     return(PathInfo.Create(System.IO.Path.ChangeExtension(fileName.ToString(), extension)));
 }
示例#19
0
 public IFileInfo GetFileInfo(PathInfo filePath)
 {
     return(new ZipFileInfo(filePath, _etag));
 }
示例#20
0
 public string GetExtension(PathInfo path)
 {
     return(System.IO.Path.GetExtension(path.ToString()));
 }
示例#21
0
 public bool DirectoryExists(PathInfo directory)
 {
     return(_directoryInfo.Contains(directory));
 }
示例#22
0
 private FileInfo(PathInfo filePath, System.IO.FileInfo fileInfo)
 {
     FilePath = filePath;
     Etag     = fileInfo.LastWriteTimeUtc.Ticks.ToString("X8");
 }
示例#23
0
 public void CreateDirectory(PathInfo directory)
 {
     throw new NotSupportedException();
 }