diff options
author | Brett Porter <brett@apache.org> | 2007-02-07 22:56:33 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2007-02-07 22:56:33 +0000 |
commit | dc1905e16a45069d844e99a88aa65b065adcc59e (patch) | |
tree | 776c064742dcdb7129df21a34d629071b7e24476 /archiva-configuration | |
parent | a2bc87deb7cefaa544e17637e71cf9cb1a3da6b8 (diff) | |
download | archiva-dc1905e16a45069d844e99a88aa65b065adcc59e.tar.gz archiva-dc1905e16a45069d844e99a88aa65b065adcc59e.zip |
move sanitize to configuration class
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@504728 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-configuration')
-rw-r--r-- | archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java | 24 | ||||
-rw-r--r-- | archiva-configuration/src/main/mdo/configuration.mdo | 18 |
2 files changed, 19 insertions, 23 deletions
diff --git a/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java b/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java index 911f7eb87..b99e7735e 100644 --- a/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java +++ b/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultConfigurationStore.java @@ -20,7 +20,6 @@ package org.apache.maven.archiva.configuration; */ import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; import org.apache.maven.archiva.configuration.io.xpp3.ConfigurationXpp3Reader; import org.apache.maven.archiva.configuration.io.xpp3.ConfigurationXpp3Writer; import org.codehaus.plexus.logging.AbstractLogEnabled; @@ -103,7 +102,7 @@ public class DefaultConfigurationStore try { configuration = reader.read( fileReader, false ); - sanitizeConfiguration( configuration ); + configuration.sanitize(); } catch ( IOException e ) { @@ -121,27 +120,6 @@ public class DefaultConfigurationStore return configuration; } - /** - * Perform any Upgrades and Adjustments needed to bring configuration up to the - * current configuration format. - * - * @param config the configuration to upgrade and adjust. - */ - private void sanitizeConfiguration( Configuration config ) - { - Iterator it = config.getRepositories().iterator(); - while ( it.hasNext() ) - { - RepositoryConfiguration repo = (RepositoryConfiguration) it.next(); - - // Ensure that the repo.urlName is set. - if ( StringUtils.isEmpty( repo.getUrlName() ) ) - { - repo.setUrlName( repo.getId() ); - } - } - } - public void storeConfiguration( Configuration configuration ) throws ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException { diff --git a/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-configuration/src/main/mdo/configuration.mdo index e869ce089..274f83f52 100644 --- a/archiva-configuration/src/main/mdo/configuration.mdo +++ b/archiva-configuration/src/main/mdo/configuration.mdo @@ -133,6 +133,24 @@ return valid;
}
+ /**
+ * Perform any Upgrades and Adjustments needed to bring configuration up to the
+ * current configuration format.
+ */
+ public void sanitize()
+ {
+ for ( java.util.Iterator i = getRepositories().iterator(); i.hasNext(); )
+ {
+ RepositoryConfiguration repo = (RepositoryConfiguration) i.next();
+
+ // Ensure that the repo.urlName is set.
+ if ( org.codehaus.plexus.util.StringUtils.isEmpty( repo.getUrlName() ) )
+ {
+ repo.setUrlName( repo.getId() );
+ }
+ }
+ }
+
public RepositoryConfiguration getRepositoryByUrlName( String urlName )
{
for ( java.util.Iterator i = getRepositories().iterator(); i.hasNext(); )
|