You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by cz...@apache.org on 2001/12/27 16:05:47 UTC
cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/source SourceResolverImpl.java
cziegeler 01/12/27 07:05:47
Modified: src/scratchpad/org/apache/avalon/excalibur/source
SourceResolverImpl.java
Log:
Minor cosmetics
Revision Changes Path
1.10 +21 -8 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/source/SourceResolverImpl.java
Index: SourceResolverImpl.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/source/SourceResolverImpl.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- SourceResolverImpl.java 2001/12/11 09:53:36 1.9
+++ SourceResolverImpl.java 2001/12/27 15:05:47 1.10
@@ -41,11 +41,12 @@
* etc.
*
* When the <code>Source</code> object is no longer needed
- * it must be release using the resolver. This is very similar like
- * looking up components from a <code>ComponentManager</code>.
+ * it must be released using the resolver. This is very similar like
+ * looking up components from a <code>ComponentManager</code>
+ * and releasing them.
*
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version $Id: SourceResolverImpl.java,v 1.9 2001/12/11 09:53:36 jefft Exp $
+ * @version $Id: SourceResolverImpl.java,v 1.10 2001/12/27 15:05:47 cziegeler Exp $
*/
public class SourceResolverImpl
extends AbstractLogEnabled
@@ -79,6 +80,10 @@
// set the base URL to the current directory
try {
this.baseURL = new File(System.getProperty("user.dir")).toURL();
+ if ( this.getLogger().isDebugEnabled() )
+ {
+ this.getLogger().debug("SourceResolver: Using base directory: " + this.baseURL);
+ }
} catch (MalformedURLException mue) {
throw new ConfigurationException("Malformed URL for user.dir");
}
@@ -163,7 +168,9 @@
String location,
SourceParameters parameters)
throws MalformedURLException, IOException, ComponentException {
- this.getLogger().debug("Resolving '"+location+"' in context '" + base + "'");
+ if (this.getLogger().isDebugEnabled() == true) {
+ this.getLogger().debug("Resolving '"+location+"' in context '" + base + "'");
+ }
if (location == null) throw new MalformedURLException("Invalid System ID");
// first step: create systemID
@@ -195,7 +202,9 @@
systemID = new URL(base, location).toExternalForm();
}
}
- this.getLogger().debug("Resolved to systemID '"+systemID+"'");
+ if (this.getLogger().isDebugEnabled() == true) {
+ this.getLogger().debug("Resolved to systemID '"+systemID+"'");
+ }
Source source = null;
// search for a SourceFactory implementing the protocol
@@ -216,11 +225,15 @@
if ( source == null ) {
// no factory found, so usual url handling stuff...
try {
- getLogger().debug("Making URL from " + systemID);
+ if (this.getLogger().isDebugEnabled() == true) {
+ getLogger().debug("Making URL from " + systemID);
+ }
source = new URLSource(new URL(systemID), parameters);
} catch (MalformedURLException mue) {
- getLogger().debug("Making URL - MalformedURLException in getURL:" , mue);
- getLogger().debug("Making URL a File (assuming that it is full path):" + systemID);
+ if (this.getLogger().isDebugEnabled() == true) {
+ getLogger().debug("Making URL - MalformedURLException in getURL:" , mue);
+ getLogger().debug("Making URL a File (assuming that it is full path):" + systemID);
+ }
source = new URLSource((new File(systemID)).toURL(), parameters);
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>