Refactor general configuration

Use standard configuration store api for general configuration. This is best practice and also required for the audit log to work properly.

Besides that we still need to load the general configuration manually for the instance injection binding in ScmServletModules. Since the instance injection does not resolve the bindings regularly we need also still need to update the injectable scm config using the "load" hack in the resource.

Committed-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2023-04-12 12:37:52 +02:00
committed by SCM-Manager
parent aa78cb6f03
commit c6df84557b
19 changed files with 274 additions and 353 deletions

View File

@@ -41,37 +41,25 @@ import java.io.OutputStream;
import static com.google.common.base.Preconditions.checkNotNull;
//~--- JDK imports ------------------------------------------------------------
/**
*
* @author Sebastian Sdorra <s.sdorra@gmail.com>
*/
public class SvnBundleCommand extends AbstractSvnCommand
implements BundleCommand
{
implements BundleCommand {
private static final String DUMP = "dump";
public SvnBundleCommand(SvnContext context)
{
public SvnBundleCommand(SvnContext context) {
super(context);
}
private static void dump(SVNAdminClient adminClient, File repository,
ByteSink target)
throws SVNException, IOException
{
ByteSink target)
throws SVNException, IOException {
OutputStream outputStream = null;
try
{
try {
outputStream = target.openBufferedStream();
adminClient.doDump(repository, outputStream, SVNRevision.create(-1l),
SVNRevision.HEAD, false, false);
}
finally
{
} finally {
Closeables.close(outputStream, true);
}
}
@@ -79,27 +67,22 @@ public class SvnBundleCommand extends AbstractSvnCommand
@Override
public BundleResponse bundle(BundleCommandRequest request) throws IOException {
ByteSink archive = checkNotNull(request.getArchive(),
"archive is required");
"archive is required");
BundleResponse response;
SVNClientManager clientManager = null;
try
{
try {
clientManager = SVNClientManager.newInstance();
SVNAdminClient adminClient = clientManager.getAdminClient();
dump(adminClient, context.getDirectory(), archive);
response = new BundleResponse(context.open().getLatestRevision());
}
catch (SVNException ex)
{
} catch (SVNException ex) {
throw new IOException("could not create dump", ex);
}
finally
{
} finally {
SvnUtil.dispose(clientManager);
}

View File

@@ -55,9 +55,6 @@ import java.util.concurrent.Callable;
import static com.google.common.base.Preconditions.checkNotNull;
import static sonia.scm.repository.RepositoryHookType.POST_RECEIVE;
/**
* @author Sebastian Sdorra <s.sdorra@gmail.com>
*/
public class SvnUnbundleCommand extends AbstractSvnCommand implements UnbundleCommand {
private static final Logger LOG = LoggerFactory.getLogger(SvnUnbundleCommand.class);

View File

@@ -33,7 +33,6 @@ import sonia.scm.plugin.Extension;
/**
*
* @author Sebastian Sdorra <s.sdorra@gmail.com>
* @since 1.45
*/
@Extension