@Test public void testResolveSibling_givenEmptyPath() { Path path = pathService.parsePath("foo/bar"); Path resolved = path.resolveSibling(""); assertPathEquals("foo", resolved); path = pathService.parsePath("foo"); resolved = path.resolveSibling(""); assertPathEquals("", resolved); }
@Override public JimfsPath resolveSibling(Path other) { JimfsPath otherPath = checkPath(other); if (otherPath == null) { throw new ProviderMismatchException(other.toString()); } if (otherPath.isAbsolute()) { return otherPath; } JimfsPath parent = getParent(); if (parent == null) { return otherPath; } return parent.resolve(other); }
JimfsPath implements Path { @Override public JimfsPath resolveSibling(Path other) { JimfsPath otherPath = checkPath(other); if (otherPath == null) { throw new ProviderMismatchException(other.toString()); } if (otherPath.isAbsolute()) { return otherPath; } JimfsPath parent = getParent(); if (parent == null) { return otherPath; } return parent.resolve(other); } }
JimfsPath implements Path { @Override public JimfsPath resolveSibling(Path other) { JimfsPath otherPath = checkPath(other); if (otherPath == null) { throw new ProviderMismatchException(other.toString()); } if (otherPath.isAbsolute()) { return otherPath; } JimfsPath parent = getParent(); if (parent == null) { return otherPath; } return parent.resolve(other); } JimfsPath(PathService pathService, @NullableDecl Name root, Iterable<Name> names); }
JimfsPath implements Path { @Override public JimfsPath resolveSibling(Path other) { JimfsPath otherPath = checkPath(other); if (otherPath == null) { throw new ProviderMismatchException(other.toString()); } if (otherPath.isAbsolute()) { return otherPath; } JimfsPath parent = getParent(); if (parent == null) { return otherPath; } return parent.resolve(other); } JimfsPath(PathService pathService, @NullableDecl Name root, Iterable<Name> names); @NullableDecl Name root(); ImmutableList<Name> names(); @NullableDecl Name name(); boolean isEmptyPath(); @Override FileSystem getFileSystem(); JimfsFileSystem getJimfsFileSystem(); @Override boolean isAbsolute(); @Override JimfsPath getRoot(); @Override JimfsPath getFileName(); @Override JimfsPath getParent(); @Override int getNameCount(); @Override JimfsPath getName(int index); @Override JimfsPath subpath(int beginIndex, int endIndex); @Override boolean startsWith(Path other); @Override boolean startsWith(String other); @Override boolean endsWith(Path other); @Override boolean endsWith(String other); @Override JimfsPath normalize(); @Override JimfsPath resolve(Path other); @Override JimfsPath resolve(String other); @Override JimfsPath resolveSibling(Path other); @Override JimfsPath resolveSibling(String other); @Override JimfsPath relativize(Path other); @Override JimfsPath toAbsolutePath(); @Override JimfsPath toRealPath(LinkOption... options); @Override WatchKey register(
      WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers); @Override WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events); @Override URI toUri(); @Override File toFile(); @Override Iterator<Path> iterator(); @Override int compareTo(Path other); @Override boolean equals(@NullableDecl Object obj); @Override int hashCode(); @Override String toString(); }
JimfsPath implements Path { @Override public JimfsPath resolveSibling(Path other) { JimfsPath otherPath = checkPath(other); if (otherPath == null) { throw new ProviderMismatchException(other.toString()); } if (otherPath.isAbsolute()) { return otherPath; } JimfsPath parent = getParent(); if (parent == null) { return otherPath; } return parent.resolve(other); } JimfsPath(PathService pathService, @NullableDecl Name root, Iterable<Name> names); @NullableDecl Name root(); ImmutableList<Name> names(); @NullableDecl Name name(); boolean isEmptyPath(); @Override FileSystem getFileSystem(); JimfsFileSystem getJimfsFileSystem(); @Override boolean isAbsolute(); @Override JimfsPath getRoot(); @Override JimfsPath getFileName(); @Override JimfsPath getParent(); @Override int getNameCount(); @Override JimfsPath getName(int index); @Override JimfsPath subpath(int beginIndex, int endIndex); @Override boolean startsWith(Path other); @Override boolean startsWith(String other); @Override boolean endsWith(Path other); @Override boolean endsWith(String other); @Override JimfsPath normalize(); @Override JimfsPath resolve(Path other); @Override JimfsPath resolve(String other); @Override JimfsPath resolveSibling(Path other); @Override JimfsPath resolveSibling(String other); @Override JimfsPath relativize(Path other); @Override JimfsPath toAbsolutePath(); @Override JimfsPath toRealPath(LinkOption... options); @Override WatchKey register(
      WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers); @Override WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events); @Override URI toUri(); @Override File toFile(); @Override Iterator<Path> iterator(); @Override int compareTo(Path other); @Override boolean equals(@NullableDecl Object obj); @Override int hashCode(); @Override String toString();  }