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/merlin-core/src/java/org/apache/avalon/merlin/block/impl XMLContainerCreator.java
Date Thu, 03 Jul 2003 19:05:01 GMT
mcconnell    2003/07/03 12:05:01

  Modified:    merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl
                        XMLContainerCreator.java
  Log:
  Update the base url resolution so that we don't assume jar: protocols.
  
  Revision  Changes    Path
  1.7       +10 -8     avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/XMLContainerCreator.java
  
  Index: XMLContainerCreator.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/XMLContainerCreator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLContainerCreator.java	22 Jun 2003 13:57:56 -0000	1.6
  +++ XMLContainerCreator.java	3 Jul 2003 19:05:01 -0000	1.7
  @@ -303,8 +303,7 @@
           catch( Throwable e )
           {
               final String error = 
  -              "Unable to read the block directive relative to the source:"
  -                + source;
  +              "Cannot include an imported block defintion.";
               throw new ContainerException( error, e );
           }
   
  @@ -683,6 +682,7 @@
               //
   
               URL url = getBasePath( source );
  +
               EngineClassLoader engine = createEngine( url, parent, name, conf );
   
               //
  @@ -1046,7 +1046,7 @@
       private Configuration getSourceConfiguration( final URL url ) throws ContainerException
       {
           String uri = url.toString();
  -        if( url.getProtocol().equals( "jar" ) )
  +        if( url.getProtocol().equals( "jar" ) || uri.endsWith( ".jar" ) )
           {
               try
               {
  @@ -1056,12 +1056,13 @@
               catch( Throwable e )
               {
                   final String error =
  -                  "Unable to resolve packaged block description on path: " + url;
  +                  "Unable to resolve packaged block description.\nurl: " + url;
                   throw new ContainerException( error, e );
               }
           }
           else
           {
  +
               // its either a simulated block or include
   
               try
  @@ -1070,14 +1071,15 @@
               }
               catch( Throwable e )
               {
  +                String internal = uri + "BLOCK-INF/block.xml";
                   try
                   {
  -                    return createConfiguration( uri + "BLOCK-INF/block.xml" );
  +                    return createConfiguration( internal );
                   }
                   catch( Throwable ce )
                   {
                       final String error =
  -                      "Unable to resolve block description on path: " + uri;
  +                      "Unable to build configuration from path - \npath: " + internal;
                       throw new ContainerException( error, e );
                   }
               }
  @@ -1180,7 +1182,7 @@
               return null;
           }
   
  -        if( url.getProtocol().equals( "jar" ) )
  +        if( url.getProtocol().equals( "jar" ) || url.toString().endsWith( ".jar" ) )
           {
               return url;
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message