cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/framework Configurations.java
Date Mon, 01 May 2000 23:51:18 GMT
stefano     00/05/01 16:51:18

  Modified:    src/org/apache/cocoon/framework Configurations.java
  Log:
  allowed configurations to be created from streams
  
  Revision  Changes    Path
  1.7       +21 -2     xml-cocoon/src/org/apache/cocoon/framework/Configurations.java
  
  Index: Configurations.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/framework/Configurations.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Configurations.java	2000/02/13 18:29:22	1.6
  +++ Configurations.java	2000/05/01 23:51:18	1.7
  @@ -1,4 +1,4 @@
  -/*-- $Id: Configurations.java,v 1.6 2000/02/13 18:29:22 stefano Exp $ --
  +/*-- $Id: Configurations.java,v 1.7 2000/05/01 23:51:18 stefano Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -58,7 +58,7 @@
    * class to work.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.6 $ $Date: 2000/02/13 18:29:22 $
  + * @version $Revision: 1.7 $ $Date: 2000/05/01 23:51:18 $
    */
   
   public class Configurations {
  @@ -89,6 +89,25 @@
           InputStream input = new FileInputStream(file);
           properties.load(input);
           input.close();
  +    }
  +
  +    /**                                                                  
  +     * Create the class from a the InputStream                           
  +     */                                                                  
  +    public Configurations(InputStream stream) throws Exception {         
  +        this(stream, null);                                              
  +    }                                                                    
  +                                                                         
  +    /**
  +     * Create the class with given defaults and from the URL resource
  +     */
  +    public Configurations(InputStream stream, Configurations defaults) throws Exception
{
  +        if (defaults != null) {
  +            properties = new Properties(defaults.properties);
  +        } else {
  +            properties = new Properties();
  +        }
  +        properties.load(stream);
       }
   
       /**
  
  
  

Mime
View raw message