mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-04-01 18:00:12 +02:00
use svnkit to create svn repositories
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.repository;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -72,18 +74,6 @@ public abstract class AbstractSimpleRepositoryHandler<C extends SimpleRepository
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repository
|
||||
* @param directory
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected abstract ExtendedCommand buildCreateCommand(Repository repository,
|
||||
File directory);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -106,19 +96,7 @@ public abstract class AbstractSimpleRepositoryHandler<C extends SimpleRepository
|
||||
throw new RepositoryAllreadyExistExeption();
|
||||
}
|
||||
|
||||
ExtendedCommand cmd = buildCreateCommand(repository, directory);
|
||||
CommandResult result = cmd.execute();
|
||||
|
||||
if (!result.isSuccessfull())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder("command exit with error ");
|
||||
|
||||
msg.append(result.getReturnCode()).append(" and message: '");
|
||||
msg.append(result.getOutput()).append("'");
|
||||
|
||||
throw new RepositoryException(msg.toString());
|
||||
}
|
||||
|
||||
create(repository, directory);
|
||||
postCreate(repository, directory);
|
||||
repository.setType(getType().getName());
|
||||
storeRepositoryConfig(repository);
|
||||
@@ -273,6 +251,48 @@ public abstract class AbstractSimpleRepositoryHandler<C extends SimpleRepository
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repository
|
||||
* @param directory
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected ExtendedCommand buildCreateCommand(Repository repository,
|
||||
File directory)
|
||||
{
|
||||
throw new UnsupportedOperationException("method is not implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param repository
|
||||
* @param directory
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
protected void create(Repository repository, File directory)
|
||||
throws RepositoryException, IOException
|
||||
{
|
||||
ExtendedCommand cmd = buildCreateCommand(repository, directory);
|
||||
CommandResult result = cmd.execute();
|
||||
|
||||
if (!result.isSuccessfull())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder("command exit with error ");
|
||||
|
||||
msg.append(result.getReturnCode()).append(" and message: '");
|
||||
msg.append(result.getOutput()).append("'");
|
||||
|
||||
throw new RepositoryException(msg.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user