RepositoryPath implements Path { public RepositoryPath resolve(Path other) { if (other == null) { return this; } other = unwrap(other); validatePathRelativized(other); return wrap(getTarget().resolve(other)); } RepositoryPath(Path target,
                          LayoutFileSystem fileSystem); ArtifactEntry getArtifactEntry(); LayoutFileSystem getFileSystem(); Repository getRepository(); boolean isAbsolute(); RepositoryPath getRoot(); Path getFileName(); RepositoryPath getParent(); int getNameCount(); RepositoryPath getName(int index); RepositoryPath subpath(int beginIndex,
                                  int endIndex); boolean startsWith(Path other); boolean startsWith(String other); boolean endsWith(Path other); boolean endsWith(String other); RepositoryPath normalize(); RepositoryPath resolve(Path other); RepositoryPath resolve(String other); RepositoryPath resolveSibling(Path other); RepositoryPath resolveSibling(String other); RepositoryPath relativize(Path other); RepositoryPath relativize(); URI toUri(); RepositoryPath toAbsolutePath(); RepositoryPath toRealPath(LinkOption... options); @Deprecated File toFile(); WatchKey register(WatchService watcher,
                             Kind<?>[] events,
                             Modifier... modifiers); WatchKey register(WatchService watcher,
                             Kind<?>... events); Iterator<Path> iterator(); int compareTo(Path other); RepositoryPath wrap(Path path); String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void repositoryPathShouldNotResolvePathAbsolutePaths() { assertThatExceptionOfType(RepositoryRelativePathConstructionException.class) .isThrownBy(() -> { RepositoryPath path = new RepositoryPath(REPOSITORY_BASEDIR, repositoryFileSystem); path.resolve(Paths.get("/absolute")); }); }
@Test public void repositoryPathShouldResolveStringRelativePaths() { RepositoryPath path = new RepositoryPath(REPOSITORY_BASEDIR, repositoryFileSystem); path = path.resolve("relative"); assertThat(path).isEqualTo(REPOSITORY_BASEDIR.resolve("relative")); }
@Test public void repositoryPathShouldResolvePathRelativePaths() { RepositoryPath path = new RepositoryPath(REPOSITORY_BASEDIR, repositoryFileSystem); path = path.resolve(Paths.get("relative")); assertThat(path).isEqualTo(REPOSITORY_BASEDIR.resolve("relative")); }
@Test public void repositoryPathShouldNotResolveStringAbsolutePaths() { assertThatExceptionOfType(RepositoryRelativePathConstructionException.class) .isThrownBy(() -> { RepositoryPath path = new RepositoryPath(REPOSITORY_BASEDIR, repositoryFileSystem); path.resolve("/absolute"); }); }