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