]> source.dussan.org Git - archiva.git/commitdiff
- Updated the code for escaping/unescaping cron expressions in DefaultArchivaConfigur...
authorMaria Odea B. Ching <oching@apache.org>
Tue, 21 Aug 2007 14:35:15 +0000 (14:35 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Tue, 21 Aug 2007 14:35:15 +0000 (14:35 +0000)
repositories.jsp

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@568146 13f79535-47bb-0310-9956-ffa450edef68

archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java

index 82ff2069b4041e3606fadb0b10c4ad336058d661..376fac46da5bf4e7764077708a37a8fc4abb27da 100644 (file)
@@ -95,10 +95,9 @@ public class DefaultArchivaConfiguration
         if ( configuration == null )
         {
             configuration = load();
+            configuration = processExpressions( configuration );
         }
 
-        configuration = processExpressions( configuration );
-
         return configuration;
     }
 
@@ -178,12 +177,23 @@ public class DefaultArchivaConfiguration
             }
         }
 
-        configuration = escapeCronExpressions( configuration );
+        // escape all cron expressions to handle ','
+        for ( Iterator i = configuration.getRepositories().iterator(); i.hasNext(); )
+        {
+            RepositoryConfiguration c = (RepositoryConfiguration) i.next();
+            c.setRefreshCronExpression( escapeCronExpression( c.getRefreshCronExpression() ) );
+        }
+
+        if ( configuration.getDatabaseScanning() != null )
+        {
+            configuration.getDatabaseScanning().setCronExpression( escapeCronExpression(
+                configuration.getDatabaseScanning().getCronExpression() ) );
+        }
 
         new ConfigurationRegistryWriter().write( configuration, section );
         section.save();
 
-        this.configuration = configuration;
+        this.configuration = processExpressions( configuration );
     }
 
     private Registry createDefaultConfigurationFile()
@@ -295,24 +305,4 @@ public class DefaultArchivaConfiguration
 
         return config;
     }
-
-    private Configuration escapeCronExpressions( Configuration config )
-    {
-        for ( Iterator i = config.getRepositories().iterator(); i.hasNext(); )
-        {
-            RepositoryConfiguration c = (RepositoryConfiguration) i.next();
-
-            c.setRefreshCronExpression( escapeCronExpression( c.getRefreshCronExpression() ) );
-        }
-
-        DatabaseScanningConfiguration databaseScanning = config.getDatabaseScanning();
-        if ( databaseScanning != null )
-        {
-            String cron = databaseScanning.getCronExpression();
-            databaseScanning.setCronExpression( escapeCronExpression( cron ) );
-        }
-
-        return config;
-    }
-
 }