mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
use only configured handlers
This commit is contained in:
@@ -168,6 +168,8 @@ public class BasicRepositoryManager extends AbstractRepositoryManager
|
||||
Repository repository = null;
|
||||
|
||||
for (RepositoryHandler handler : handlerMap.values())
|
||||
{
|
||||
if (handler.isConfigured())
|
||||
{
|
||||
repository = handler.get(id);
|
||||
|
||||
@@ -176,6 +178,7 @@ public class BasicRepositoryManager extends AbstractRepositoryManager
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return repository;
|
||||
}
|
||||
@@ -192,6 +195,8 @@ public class BasicRepositoryManager extends AbstractRepositoryManager
|
||||
Set<Repository> repositories = new HashSet<Repository>();
|
||||
|
||||
for (RepositoryHandler handler : handlerMap.values())
|
||||
{
|
||||
if (handler.isConfigured())
|
||||
{
|
||||
Collection<Repository> handlerRepositories = handler.getAll();
|
||||
|
||||
@@ -200,6 +205,7 @@ public class BasicRepositoryManager extends AbstractRepositoryManager
|
||||
repositories.addAll(handlerRepositories);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return repositories;
|
||||
}
|
||||
@@ -224,10 +230,11 @@ public class BasicRepositoryManager extends AbstractRepositoryManager
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws RepositoryHandlerNotFoundException
|
||||
*
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
private RepositoryHandler getHandler(Repository repository)
|
||||
throws RepositoryHandlerNotFoundException
|
||||
throws RepositoryException
|
||||
{
|
||||
String type = repository.getType();
|
||||
RepositoryHandler handler = handlerMap.get(type);
|
||||
@@ -237,6 +244,10 @@ public class BasicRepositoryManager extends AbstractRepositoryManager
|
||||
throw new RepositoryHandlerNotFoundException(
|
||||
"could not find handler for ".concat(type));
|
||||
}
|
||||
else if (!handler.isConfigured())
|
||||
{
|
||||
throw new RepositoryException("handler is not configured");
|
||||
}
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user