Пример #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");
 }
Пример #2
0
            public static FileInfo Create(PathInfo filePath)
            {
                System.IO.FileInfo fileInfo;
                try
                {
                    fileInfo = new System.IO.FileInfo(filePath.ToString());
                }
                catch
                {
                    fileInfo = null;
                }

                if (fileInfo == null)
                {
                    return(null);
                }

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