mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-04 20:45:52 +01:00
improve scm-hg-plugin
This commit is contained in:
@@ -301,6 +301,56 @@ public abstract class AbstractSimpleRepositoryHandler<C extends SimpleRepository
|
||||
return repositories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repositoryname
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Repository getByName(String repositoryname)
|
||||
{
|
||||
Repository repository = null;
|
||||
|
||||
for (Repository r : getAll())
|
||||
{
|
||||
if (r.getName().equals(repositoryname))
|
||||
{
|
||||
repository = r;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repository
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public File getDirectory(Repository repository)
|
||||
{
|
||||
File directory = null;
|
||||
|
||||
if (isConfigured())
|
||||
{
|
||||
directory = new File(config.getRepositoryDirectory(),
|
||||
repository.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ConfigurationException("RepositoryHandler is not configured");
|
||||
}
|
||||
|
||||
return directory;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -400,31 +450,6 @@ public abstract class AbstractSimpleRepositoryHandler<C extends SimpleRepository
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repository
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected File getDirectory(Repository repository)
|
||||
{
|
||||
File directory = null;
|
||||
|
||||
if (isConfigured())
|
||||
{
|
||||
directory = new File(config.getRepositoryDirectory(),
|
||||
repository.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ConfigurationException("RepositoryHandler is not configured");
|
||||
}
|
||||
|
||||
return directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user