Fix path computation and resolving

This commit is contained in:
René Pfeuffer
2019-05-10 13:26:06 +02:00
parent 7f4792ec49
commit a83e2813a3
8 changed files with 522 additions and 537 deletions

View File

@@ -173,6 +173,6 @@ public abstract class AbstractSimpleRepositoryHandler<C extends RepositoryConfig
}
private File resolveNativeDirectory(String repositoryId) {
return repositoryLocationResolver.forClass(Path.class).getLocation(repositoryId).resolve(REPOSITORIES_NATIVE_DIRECTORY).toFile();
return repositoryLocationResolver.create(Path.class).getLocation(repositoryId).resolve(REPOSITORIES_NATIVE_DIRECTORY).toFile();
}
}

View File

@@ -6,8 +6,7 @@ public abstract class RepositoryLocationResolver {
protected abstract <T> RepositoryLocationResolverInstance<T> create(Class<T> type);
// TODO make final, but fix mockito mocking
public <T> RepositoryLocationResolverInstance<T> forClass(Class<T> type) {
public final <T> RepositoryLocationResolverInstance<T> forClass(Class<T> type) {
if (!supportsLocationType(type)) {
throw new IllegalStateException("no support for location of class " + type);
}