vmassol     2002/06/07 13:25:24

  Modified:    framework/src/java/share/org/apache/cactus/util
                        Configuration.java
  Log:
  allow override of cactus properties defined in cactus.properties on the command line
  
  Revision  Changes    Path
  1.7       +8 -2      
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/Configuration.java
  
  Index: Configuration.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/Configuration.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Configuration.java        20 May 2002 21:49:25 -0000      1.6
  +++ Configuration.java        7 Jun 2002 20:25:24 -0000       1.7
  @@ -70,7 +70,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Massol</a>
    *
  - * @version $Id: Configuration.java,v 1.6 2002/05/20 21:49:25 vmassol Exp $
  + * @version $Id: Configuration.java,v 1.7 2002/06/07 20:25:24 vmassol Exp $
    */
   public class Configuration
   {
  @@ -142,7 +142,13 @@
               Enumeration keys = config.getKeys();
               while (keys.hasMoreElements()) {
                   String key = (String) keys.nextElement();
  -                System.setProperty(key, config.getString(key));
  +
  +                // Only set the system property if it does not already exist.
  +                // This allows to have a cactus properties file and override
  +                // some values on the command line.
  +                if (System.getProperty(key) == null) {
  +                    System.setProperty(key, config.getString(key));
  +                }
               }
   
               isInitialized = true;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to