You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by eb...@apache.org on 2004/06/21 20:42:39 UTC
cvs commit: jakarta-commons/configuration/src/java/org/apache/commons/configuration HierarchicalDOM4JConfiguration.java
ebourg 2004/06/21 11:42:39
Modified: configuration/src/java/org/apache/commons/configuration
HierarchicalDOM4JConfiguration.java
Log:
added exception chaining
Revision Changes Path
1.6 +14 -12 jakarta-commons/configuration/src/java/org/apache/commons/configuration/HierarchicalDOM4JConfiguration.java
Index: HierarchicalDOM4JConfiguration.java
===================================================================
RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/HierarchicalDOM4JConfiguration.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HierarchicalDOM4JConfiguration.java 2 Jun 2004 16:42:24 -0000 1.5
+++ HierarchicalDOM4JConfiguration.java 21 Jun 2004 18:42:39 -0000 1.6
@@ -1,5 +1,3 @@
-package org.apache.commons.configuration;
-
/*
* Copyright 2004 The Apache Software Foundation.
*
@@ -16,6 +14,8 @@
* limitations under the License.
*/
+package org.apache.commons.configuration;
+
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
@@ -35,9 +35,7 @@
*
* @version $Id$
*/
-public class HierarchicalDOM4JConfiguration
- extends HierarchicalConfiguration
- implements BasePathLoader
+public class HierarchicalDOM4JConfiguration extends HierarchicalConfiguration implements BasePathLoader
{
/** Stores the file name of the document to be parsed.*/
private String file;
@@ -102,11 +100,13 @@
*/
public void load() throws ConfigurationException
{
- try {
+ try
+ {
load(ConfigurationUtils.getURL(getBasePath(), getFileName()));
}
- catch (MalformedURLException mue){
- throw new ConfigurationException("Could not load from " + getBasePath() + ", " + getFileName());
+ catch (MalformedURLException e)
+ {
+ throw new ConfigurationException("Could not load from " + getBasePath() + ", " + getFileName(), e);
}
}
@@ -118,11 +118,13 @@
*/
public void load(URL url) throws ConfigurationException
{
- try {
+ try
+ {
initProperties(new SAXReader().read(url));
}
- catch (DocumentException de){
- throw new ConfigurationException("Could not load from " + url);
+ catch (DocumentException e)
+ {
+ throw new ConfigurationException("Could not load from " + url, e);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org