Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 14329 invoked from network); 19 Oct 2004 11:45:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Oct 2004 11:45:38 -0000 Received: (qmail 69203 invoked by uid 500); 19 Oct 2004 11:44:38 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 69105 invoked by uid 500); 19 Oct 2004 11:44:36 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 69034 invoked by uid 500); 19 Oct 2004 11:44:34 -0000 Received: (qmail 69017 invoked by uid 99); 19 Oct 2004 11:44:34 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 19 Oct 2004 04:44:33 -0700 Received: (qmail 13786 invoked by uid 1865); 19 Oct 2004 11:44:31 -0000 Date: 19 Oct 2004 11:44:31 -0000 Message-ID: <20041019114431.13785.qmail@minotaur.apache.org> From: ebourg@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/configuration/xdocs changes.xml X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ebourg 2004/10/19 04:44:31 Modified: configuration/src/java/org/apache/commons/configuration AbstractFileConfiguration.java PropertiesConfiguration.java XMLConfiguration.java configuration/xdocs changes.xml Log: Moved the constructors implementations from PropertiesConfiguration and XMLConfiguration to AbstractFileConfiguration. Revision Changes Path 1.7 +67 -1 jakarta-commons/configuration/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java Index: AbstractFileConfiguration.java =================================================================== RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/AbstractFileConfiguration.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- AbstractFileConfiguration.java 18 Oct 2004 15:45:10 -0000 1.6 +++ AbstractFileConfiguration.java 19 Oct 2004 11:44:31 -0000 1.7 @@ -53,9 +53,75 @@ protected ReloadingStrategy strategy; private Object reloadLock = new Object(); + /** + * Default constructor + * + * @since 1.1 + */ public AbstractFileConfiguration() { setReloadingStrategy(new InvariantReloadingStrategy()); + } + + /** + * Creates and loads the configuration from the specified file. + * + * @param fileName The name of the file to load. + * + * @throws ConfigurationException Error while loading the file + * @since 1.1 + */ + public AbstractFileConfiguration(String fileName) throws ConfigurationException + { + this(); + + // store the file name + this.fileName = fileName; + + // locate the file + url = ConfigurationUtils.locate(fileName); + + // update the base path + setBasePath(ConfigurationUtils.getBasePath(url)); + + // load the file + load(); + } + + /** + * Creates and loads the configuration from the specified file. + * + * @param file The file to load. + * @throws ConfigurationException Error while loading the file + * @since 1.1 + */ + public AbstractFileConfiguration(File file) throws ConfigurationException + { + this(); + + // set the file and update the url, the base path and the file name + setFile(file); + + // load the file + load(); + } + + /** + * Creates and loads the configuration from the specified URL. + * + * @param url The location of the file to load. + * @throws ConfigurationException Error while loading the file + * @since 1.1 + */ + public AbstractFileConfiguration(URL url) throws ConfigurationException + { + this(); + + // set the URL and update the base path and the file name + setURL(url); + + // load the file + load(); } /** 1.16 +5 -32 jakarta-commons/configuration/src/java/org/apache/commons/configuration/PropertiesConfiguration.java Index: PropertiesConfiguration.java =================================================================== RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/PropertiesConfiguration.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- PropertiesConfiguration.java 23 Sep 2004 11:45:07 -0000 1.15 +++ PropertiesConfiguration.java 19 Oct 2004 11:44:31 -0000 1.16 @@ -139,7 +139,7 @@ static String include = "include"; /** Allow file inclusion or not */ - private boolean includesAllowed; + private boolean includesAllowed = true; /** * Creates an empty PropertyConfiguration object which can be @@ -163,20 +163,7 @@ */ public PropertiesConfiguration(String fileName) throws ConfigurationException { - // enable includes - setIncludesAllowed(true); - - // store the file name - this.fileName = fileName; - - // locate the resource - url = ConfigurationUtils.locate(fileName); - - // update the base path - setBasePath(ConfigurationUtils.getBasePath(url)); - - // load the file - load(); + super(fileName); } /** @@ -189,14 +176,7 @@ */ public PropertiesConfiguration(File file) throws ConfigurationException { - // enable includes - setIncludesAllowed(true); - - // set the file and update the url, the base path and the file name - setFile(file); - - // load the file - load(); + super(file); } /** @@ -209,14 +189,7 @@ */ public PropertiesConfiguration(URL url) throws ConfigurationException { - // enable includes - setIncludesAllowed(true); - - // set the URL and update the base path and the file name - setURL(url); - - // load the file - load(); + super(url); } /** 1.19 +7 -11 jakarta-commons/configuration/src/java/org/apache/commons/configuration/XMLConfiguration.java Index: XMLConfiguration.java =================================================================== RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/XMLConfiguration.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- XMLConfiguration.java 18 Oct 2004 11:12:08 -0000 1.18 +++ XMLConfiguration.java 19 Oct 2004 11:44:31 -0000 1.19 @@ -101,17 +101,15 @@ } /** - * Creates and loads the XML configuration from the specified resource. + * Creates and loads the XML configuration from the specified file. * - * @param resource The name of the resource to load. + * @param fileName The name of the file to load. * * @throws ConfigurationException Error while loading the XML file */ - public XMLConfiguration(String resource) throws ConfigurationException + public XMLConfiguration(String fileName) throws ConfigurationException { - this.fileName = resource; - url = ConfigurationUtils.locate(resource); - load(); + super(fileName); } /** @@ -122,8 +120,7 @@ */ public XMLConfiguration(File file) throws ConfigurationException { - setFile(file); - load(); + super(file); } /** @@ -134,8 +131,7 @@ */ public XMLConfiguration(URL url) throws ConfigurationException { - setURL(url); - load(); + super(url); } /** 1.65 +4 -0 jakarta-commons/configuration/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/jakarta-commons/configuration/xdocs/changes.xml,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- changes.xml 19 Oct 2004 08:50:22 -0000 1.64 +++ changes.xml 19 Oct 2004 11:44:31 -0000 1.65 @@ -8,6 +8,10 @@ + + Moved the constructors implementations from PropertiesConfiguration and + XMLConfiguration to AbstractFileConfiguration. + Remove deprecated getVector() implementations. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org