use of org.sonatype.aether.repository.NoLocalRepositoryManagerException in project sonatype-aether by sonatype.
the class DefaultLocalRepositoryProvider method newLocalRepositoryManager.
public LocalRepositoryManager newLocalRepositoryManager(LocalRepository localRepository) throws NoLocalRepositoryManagerException {
List<LocalRepositoryManagerFactory> factories = new ArrayList<LocalRepositoryManagerFactory>(managerFactories);
Collections.sort(factories, COMPARATOR);
for (LocalRepositoryManagerFactory factory : factories) {
try {
LocalRepositoryManager manager = factory.newInstance(localRepository);
if (logger.isDebugEnabled()) {
StringBuilder buffer = new StringBuilder(256);
buffer.append("Using manager ").append(manager.getClass().getSimpleName());
buffer.append(" with priority ").append(factory.getPriority());
buffer.append(" for ").append(localRepository.getBasedir());
logger.debug(buffer.toString());
}
return manager;
} catch (NoLocalRepositoryManagerException e) {
// continue and try next factory
}
}
StringBuilder buffer = new StringBuilder(256);
buffer.append("No manager available for local repository ");
buffer.append(localRepository.getBasedir());
buffer.append(" of type ").append(localRepository.getContentType());
buffer.append(" using the available factories ");
for (ListIterator<LocalRepositoryManagerFactory> it = factories.listIterator(); it.hasNext(); ) {
LocalRepositoryManagerFactory factory = it.next();
buffer.append(factory.getClass().getSimpleName());
if (it.hasNext()) {
buffer.append(", ");
}
}
throw new NoLocalRepositoryManagerException(localRepository, buffer.toString());
}
Aggregations