示例#1
0
 public void ResolveTest()
 {
     Assert.AreEqual("/var/file", PathLib.Resolve("/var/lib", "../", "file/"));
     Assert.AreEqual("/var/file", PathLib.Resolve("/var/lib", "../", "", "file/"));
     Assert.AreEqual("/file", PathLib.Resolve("/var/lib", "/../", "file/"));
     Assert.AreEqual("/", PathLib.Resolve("a/b/c/", "../../.."));
     Assert.AreEqual("/", PathLib.Resolve("."));
     Assert.AreEqual("/absolute", PathLib.Resolve("/some/dir", ".", "/absolute/"));
     Assert.AreEqual("/foo/tmp.3/cycles/root.js", PathLib.Resolve("/foo/tmp.3/", "../tmp.3/cycles/root.js"));
     Assert.AreEqual("/foo", PathLib.Resolve("../foo"));
 }
示例#2
0
 private string GetPath(string realpath)
 {
     return(PathLib.Resolve(Path.GetRelativePath(realpath, _rootPath)));
 }
示例#3
0
 private async Task HandleScanner(FileSystemDirectoryWalker.WalkerItem item)
 {
     await IndexDirectory(PathLib.Resolve("/", item.Path), item.FileHandle, item.Entries);
 }
示例#4
0
 private string GetRealPath(string path)
 {
     return(Path.Join(_rootPath, PathLib.Resolve(path)));
 }