mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
read provider implementations from classpath
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
sonia.scm.repository.client.spi.GitRepositoryClientFactoryProvider
|
||||||
@@ -33,13 +33,18 @@ package sonia.scm.repository.client.api;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import sonia.scm.repository.client.spi.RepositoryClientFactoryProvider;
|
import sonia.scm.repository.client.spi.RepositoryClientFactoryProvider;
|
||||||
|
import sonia.scm.util.ServiceUtil;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
@@ -48,6 +53,16 @@ import java.io.IOException;
|
|||||||
public final class RepositoryClientFactory
|
public final class RepositoryClientFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs ...
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public RepositoryClientFactory()
|
||||||
|
{
|
||||||
|
this.providers =
|
||||||
|
ServiceUtil.getServices(RepositoryClientFactoryProvider.class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs ...
|
* Constructs ...
|
||||||
*
|
*
|
||||||
@@ -109,6 +124,24 @@ public final class RepositoryClientFactory
|
|||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Iterable<String> getAvailableTypes()
|
||||||
|
{
|
||||||
|
List<String> types = Lists.newArrayList();
|
||||||
|
|
||||||
|
for (RepositoryClientFactoryProvider provider : providers)
|
||||||
|
{
|
||||||
|
types.add(provider.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
return types;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user