avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl CLIKernelLoader.java
Date Tue, 09 Sep 2003 13:42:10 GMT
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


Mime
View raw message