Esempio n. 1
0
 public LookupDirectoryFileSystemSubscription(FileSystem parent, PathInfo prefix, string extension, Action <IEnumerable <IFileInfo> > handler)
 {
     _parent    = parent;
     _handler   = handler;
     _prefix    = PathInfo.Combine(parent._basePath, prefix);
     _extension = extension;
 }
Esempio n. 2
0
        public IFileSystem GetFileSystem(string hostPath, string path, out string basePath)
        {
            IFileSystem fileSystem;

            if (path.StartsWith("zip://"))
            {
                string baseInFile;
                var    filePath = GetFilePath(new Uri(path, UriKind.RelativeOrAbsolute), out baseInFile);
                if (!Path.IsPathRooted(filePath))
                {
                    filePath = Path.GetFullPath(Path.Combine(hostPath, filePath));
                }
                else
                {
                    filePath = Path.GetFullPath(filePath);
                }

                fileSystem = CreateZipFileSystem(filePath, baseInFile);
                basePath   = string.Empty;
            }
            else
            {
                basePath   = PathInfo.Combine(PathInfo.Create(hostPath), PathInfo.Create(path)).ToString();
                fileSystem = new FileSystem(basePath);

                basePath = string.Empty;
            }
            return(fileSystem);
        }
Esempio n. 3
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()));
 }