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