use of org.phoenicis.repository.location.ClasspathRepositoryLocation in project phoenicis by PhoenicisOrg.
the class FilesystemJsonRepositoryLocationLoader method loadRepositoryLocations.
@Override
public List<RepositoryLocation<? extends Repository>> loadRepositoryLocations() {
List<RepositoryLocation<? extends Repository>> result = new ArrayList<>();
File repositoryListFile = new File(repositoryListPath);
if (repositoryListFile.exists()) {
try {
result = this.objectMapper.readValue(new File(repositoryListPath), TypeFactory.defaultInstance().constructParametricType(List.class, RepositoryLocation.class));
} catch (IOException e) {
LOGGER.error("Couldn't load repository location list", e);
}
} else {
try {
result.add(new GitRepositoryLocation.Builder().withGitRepositoryUri(new URL("https://github.com/PhoenicisOrg/scripts").toURI()).withBranch("master").build());
result.add(new ClasspathRepositoryLocation("/org/phoenicis/repository"));
} catch (URISyntaxException | MalformedURLException e) {
LOGGER.error("Couldn't create default repository location list", e);
}
}
return result;
}
Aggregations