Example #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"));
 }
Example #2
0
 private string GetPath(string realpath)
 {
     return(PathLib.Resolve(Path.GetRelativePath(realpath, _rootPath)));
 }
Example #3
0
 private async Task HandleScanner(FileSystemDirectoryWalker.WalkerItem item)
 {
     await IndexDirectory(PathLib.Resolve("/", item.Path), item.FileHandle, item.Entries);
 }
Example #4
0
 private string GetRealPath(string path)
 {
     return(Path.Join(_rootPath, PathLib.Resolve(path)));
 }