You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2013/09/11 21:37:11 UTC
svn commit: r1522004 -
/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java
Author: oheger
Date: Wed Sep 11 19:37:10 2013
New Revision: 1522004
URL: http://svn.apache.org/r1522004
Log:
CatalogResolver no longer uses FileSystem.getInputStream(String, String).
Instead, in a first step a URL is retrieved via FileLocatorUtils.locate(). Then
from the URL an input stream is opened. After this change, FileSystem's
getInputStream(String, String) method is no longer used.
Modified:
commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java?rev=1522004&r1=1522003&r2=1522004&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java Wed Sep 11 19:37:10 2013
@@ -190,7 +190,13 @@ public class CatalogResolver implements
try
{
- InputStream is = fs.getInputStream(null, resolved);
+ URL url = FileLocatorUtils.locate(fs, null, resolved);
+ if (url == null)
+ {
+ throw new ConfigurationException("Could not locate "
+ + resolved);
+ }
+ InputStream is = fs.getInputStream(url);
InputSource iSource = new InputSource(resolved);
iSource.setPublicId(publicId);
iSource.setByteStream(is);
@@ -198,8 +204,7 @@ public class CatalogResolver implements
}
catch (Exception e)
{
- log.warn("Failed to create InputSource for " + resolved + " ("
- + e.toString() + ")");
+ log.warn("Failed to create InputSource for " + resolved, e);
return null;
}
}