@Test public void resolve_rfc3986() { Path base = Paths.parse("/b/c/d;p"); assertEquals(Paths.parse("/b/c/g"), base.resolve("g")); assertEquals(Paths.parse("/b/c/g"), base.resolve("./g")); assertEquals(Paths.parse("/b/c/g/"), base.resolve("g/")); assertEquals(Paths.parse("/g"), base.resolve("/g")); assertEquals(Paths.parse("/b/c/d;p"), base.resolve("")); assertEquals(Paths.parse("/b/c/"), base.resolve(".")); assertEquals(Paths.parse("/b/c/"), base.resolve("./")); assertEquals(Paths.parse("/b/"), base.resolve("..")); assertEquals(Paths.parse("/b/"), base.resolve("../")); assertEquals(Paths.parse("/b/g"), base.resolve("../g")); assertEquals(Paths.parse("/"), base.resolve("../..")); assertEquals(Paths.parse("/"), base.resolve("../../")); assertEquals(Paths.parse("/"), base.resolve("../../..")); assertEquals(Paths.parse("/g"), base.resolve("../../../g")); assertEquals(Paths.parse("/g"), base.resolve("/./g")); assertEquals(Paths.parse("/g"), base.resolve("/../g")); assertEquals(Paths.parse("/b/c/g."), base.resolve("g.")); assertEquals(Paths.parse("/b/c/.g"), base.resolve(".g")); assertEquals(Paths.parse("/b/c/..g"), base.resolve("..g")); assertEquals(Paths.parse("/b/c/g.."), base.resolve("g..")); assertEquals(Paths.parse("/b/g"), base.resolve("./../g")); assertEquals(Paths.parse("/b/c/g/"), base.resolve("./g/.")); assertEquals(Paths.parse("/b/c/g/h"), base.resolve("g/./h")); assertEquals(Paths.parse("/b/c/h"), base.resolve("g/../h")); assertEquals(Paths.parse("/b/c/g;x=1/y"), base.resolve("g;x=1/./y")); assertEquals(Paths.parse("/b/c/y"), base.resolve("g;x=1/../y")); }
public static Path parse(String path) { return path.isEmpty() ? ImmutablePath.EMPTY : ImmutablePath.create(new PathBuilder().splitAndAdd(path, true)); }
Paths { public static Path parse(String path) { return path.isEmpty() ? ImmutablePath.EMPTY : ImmutablePath.create(new PathBuilder().splitAndAdd(path, true)); } }
Paths { public static Path parse(String path) { return path.isEmpty() ? ImmutablePath.EMPTY : ImmutablePath.create(new PathBuilder().splitAndAdd(path, true)); }  }
Paths { public static Path parse(String path) { return path.isEmpty() ? ImmutablePath.EMPTY : ImmutablePath.create(new PathBuilder().splitAndAdd(path, true)); }  static Path of(String... segments); static Path parse(String path); static Path empty(); }
Paths { public static Path parse(String path) { return path.isEmpty() ? ImmutablePath.EMPTY : ImmutablePath.create(new PathBuilder().splitAndAdd(path, true)); }  static Path of(String... segments); static Path parse(String path); static Path empty();  }