avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader SarLoaderResolver.java
Date Fri, 01 Nov 2002 23:22:43 GMT
donaldp     2002/11/01 15:22:43

  Modified:    src/java/org/apache/avalon/phoenix/components/classloader
                        SarLoaderResolver.java
  Log:
  Resolve a location to either the work or home hierarchys.
  
  Revision  Changes    Path
  1.3       +22 -3     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/SarLoaderResolver.java
  
  Index: SarLoaderResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/SarLoaderResolver.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SarLoaderResolver.java	1 Nov 2002 22:55:27 -0000	1.2
  +++ SarLoaderResolver.java	1 Nov 2002 23:22:43 -0000	1.3
  @@ -17,6 +17,7 @@
   import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.avalon.phoenix.components.util.ResourceUtil;
   import org.apache.excalibur.loader.builder.DefaultLoaderResolver;
   
   /**
  @@ -92,6 +93,23 @@
       }
   
       /**
  +     * Resolve a location to either the work or home hierarchys.
  +     *
  +     * @param location the location
  +     * @return the URL representing location
  +     * @throws Exception if unable to resolve location
  +     */
  +    public URL resolveURL( final String location )
  +        throws Exception
  +    {
  +        final File file =
  +            ResourceUtil.getFileForResource( location,
  +                                             getBaseDirectory(),
  +                                             m_workDirectory );
  +        return file.toURL();
  +    }
  +
  +    /**
        * Resolve a fileset. Make sure it is resolved against
        * both the work and the base directories of application.
        *
  @@ -128,15 +146,16 @@
                                             final URL[] urls )
           throws Exception
       {
  +        final URL[] classpath = determineCompleteClasspath( urls );
           if( m_logger.isDebugEnabled() )
           {
               final String message =
                   REZ.getString( "resolver.loader-urls.notice",
  -                               Arrays.asList( urls ) );
  +                               Arrays.asList( classpath ) );
               m_logger.debug( message );
           }
           final PolicyClassLoader loader =
  -            new PolicyClassLoader( urls, parent, m_policy );
  +            new PolicyClassLoader( classpath, parent, m_policy );
           ContainerUtil.enableLogging( loader, m_logger );
           return loader;
       }
  
  
  

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


Mime
View raw message