mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
make plugin repository url configurable
This commit is contained in:
@@ -41,6 +41,7 @@ import com.google.inject.Singleton;
|
||||
|
||||
import sonia.scm.SCMContext;
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
import sonia.scm.plugin.PluginManager;
|
||||
import sonia.scm.util.IOUtil;
|
||||
import sonia.scm.util.SecurityUtil;
|
||||
import sonia.scm.web.security.WebSecurityContext;
|
||||
@@ -76,14 +77,16 @@ public class ConfigurationResource
|
||||
*
|
||||
* @param configuration
|
||||
* @param securityContextProvider
|
||||
* @param pluginManager
|
||||
*/
|
||||
@Inject
|
||||
public ConfigurationResource(
|
||||
ScmConfiguration configuration,
|
||||
Provider<WebSecurityContext> securityContextProvider)
|
||||
Provider<WebSecurityContext> securityContextProvider,
|
||||
ScmConfiguration configuration, PluginManager pluginManager)
|
||||
{
|
||||
this.configuration = configuration;
|
||||
this.securityContextProvider = securityContextProvider;
|
||||
this.configuration = configuration;
|
||||
this.pluginManager = pluginManager;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -118,6 +121,12 @@ public class ConfigurationResource
|
||||
ScmConfiguration newConfig)
|
||||
{
|
||||
SecurityUtil.assertIsAdmin(securityContextProvider);
|
||||
|
||||
if (!configuration.getPluginUrl().equals(newConfig.getPluginUrl()))
|
||||
{
|
||||
pluginManager.clearCache();
|
||||
}
|
||||
|
||||
configuration.load(newConfig);
|
||||
|
||||
synchronized (ScmConfiguration.class)
|
||||
@@ -141,6 +150,9 @@ public class ConfigurationResource
|
||||
/** Field description */
|
||||
public ScmConfiguration configuration;
|
||||
|
||||
/** Field description */
|
||||
private PluginManager pluginManager;
|
||||
|
||||
/** Field description */
|
||||
private Provider<WebSecurityContext> securityContextProvider;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user