You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/09/09 15:42:10 UTC
cvs commit: avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl CLIKernelLoader.java
mcconnell 2003/09/09 06:42:10
Modified: merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl
CLIKernelLoader.java
Log:
Update the kernel to handle URL block targets.
Revision Changes Path
1.16 +24 -11 avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/CLIKernelLoader.java
Index: CLIKernelLoader.java
===================================================================
RCS file: /home/cvs/avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/CLIKernelLoader.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- CLIKernelLoader.java 9 Sep 2003 02:15:27 -0000 1.15
+++ CLIKernelLoader.java 9 Sep 2003 13:42:10 -0000 1.16
@@ -327,17 +327,18 @@
for( int i=0; i<arguments.length; i++ )
{
String blockarg = arguments[i];
- try
- {
- URL url = getFile( HOME, blockarg ).toURL();
- blocks[i] = url;
- }
- catch( MalformedURLException mue )
- {
- final String error =
- "Unable to establish url to target: " + blockarg;
- throw new KernelException( error, mue );
- }
+ blocks[i] = resolveURL( blockarg );
+ //try
+ //{
+ // URL url = getFile( HOME, blockarg ).toURL();
+ // blocks[i] = url;
+ //}
+ //catch( MalformedURLException mue )
+ //{
+ // final String error =
+ // "Unable to establish url to target: " + blockarg;
+ // throw new KernelException( error, mue );
+ //}
}
}
@@ -404,6 +405,18 @@
final String error =
"Unexpected error during kernel context instantiation.";
throw new KernelException( error, e );
+ }
+ }
+
+ private URL resolveURL( String path ) throws IOException
+ {
+ try
+ {
+ return new URL( path );
+ }
+ catch( Throwable e )
+ {
+ return getFile( HOME, path ).toURL();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org