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/assembly/src/java/org/apache/avalon/assembly/engine DefaultRepositoryManager.java
Date Sun, 16 Feb 2003 10:58:37 GMT
mcconnell    2003/02/16 02:58:36

  Modified:    assembly/src/java/org/apache/avalon/assembly/engine
                        DefaultRepositoryManager.java
  Log:
  Improved handling of jar URLs.
  
  Revision  Changes    Path
  1.11      +15 -2     avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/engine/DefaultRepositoryManager.java
  
  Index: DefaultRepositoryManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/assembly/src/java/org/apache/avalon/assembly/engine/DefaultRepositoryManager.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultRepositoryManager.java	4 Feb 2003 05:42:33 -0000	1.10
  +++ DefaultRepositoryManager.java	16 Feb 2003 10:58:36 -0000	1.11
  @@ -61,6 +61,7 @@
   import java.net.JarURLConnection;
   import java.net.URL;
   import java.net.URLClassLoader;
  +import java.net.MalformedURLException;
   import java.util.ArrayList;
   import java.util.Enumeration;
   import java.util.Hashtable;
  @@ -264,7 +265,7 @@
               // for service and type defintions
               //
   
  -            final URL resource = new URL( "jar:" + url.toString() + "!/" );
  +            URL resource = getJarURL( url );
               final JarURLConnection jar = (JarURLConnection)resource.openConnection();
               final JarFile base = jar.getJarFile();
               m_scanned.add( url );
  @@ -281,6 +282,18 @@
           {
               final String error = "Unexpected exception while inspecting manifest on file:
";
               throw new EngineRuntimeException( error + url, e );
  +        }
  +    }
  +
  +    private URL getJarURL( URL url ) throws MalformedURLException
  +    {
  +        if( url.getProtocol().equals( "jar" ) )
  +        {
  +            return url;
  +        }
  +        else
  +        { 
  +            return new URL( "jar:" + url.toString() + "!/" );
           }
       }
   
  
  
  

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


Mime
View raw message