Beispiel #1
0
 public ZipFileSystem(string filePath, string rootPath)
 {
     _filePath       = PathInfo.Create(filePath);
     _rootPath       = PathInfo.Create(rootPath);
     _rootPathString = _rootPath.ToString();
     _rootPathLength = _rootPathString.Length;
     _file           = new ZipFile(filePath);
     _etag           = new FileInfo(filePath).LastWriteTimeUtc.Ticks.ToString("X8");
 }
Beispiel #2
0
            public static FileInfo Create(PathInfo filePath)
            {
                var fileInfo = new System.IO.FileInfo(filePath.ToString());

                if (!fileInfo.Exists)
                {
                    return(null);
                }

                return(new FileInfo(filePath, fileInfo));
            }
Beispiel #3
0
 public string GetExtension(PathInfo path)
 {
     return(System.IO.Path.GetExtension(path.ToString()));
 }
Beispiel #4
0
 public PathInfo GetFileNameWithoutExtension(PathInfo path)
 {
     return(PathInfo.Create(System.IO.Path.GetFileNameWithoutExtension(path.ToString())));
 }
Beispiel #5
0
 public PathInfo ChangeExtension(PathInfo fileName, string extension)
 {
     return(PathInfo.Create(System.IO.Path.ChangeExtension(fileName.ToString(), extension)));
 }
Beispiel #6
0
 public PathInfo GetDirectoryName(PathInfo filePath)
 {
     return(PathInfo.Create(System.IO.Path.GetDirectoryName(filePath.ToString())));
 }