ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library DefaultLibraryManager.java Resources.properties
Date Wed, 22 May 2002 07:26:26 GMT
adammurdoch    02/05/22 00:26:26

  Modified:    container/src/java/org/apache/myrmidon/components/library
                        DefaultLibraryManager.java Resources.properties
  Log:
  Changed DefaultLibraryManager.createLibrary() to handle directories in the
  supplied lib class-path.  Doesn't handle them very well (yet).
  
  Revision  Changes    Path
  1.8       +12 -11    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java
  
  Index: DefaultLibraryManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultLibraryManager.java	18 May 2002 23:36:32 -0000	1.7
  +++ DefaultLibraryManager.java	22 May 2002 07:26:25 -0000	1.8
  @@ -39,7 +39,7 @@
    * The default library manager implementation.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.7 $ $Date: 2002/05/18 23:36:32 $
  + * @version $Revision: 1.8 $ $Date: 2002/05/22 07:26:25 $
    */
   public class DefaultLibraryManager
       implements LibraryManager, Contextualizable, Serviceable, Initializable
  @@ -366,16 +366,17 @@
           }
           if( file.isDirectory() )
           {
  -            // TODO - handle directories
  -            final String message = REZ.getString( "file-is-dir.error", file );
  -            throw new Exception( message );
  +            // TODO - handle directories properly
  +            return new OptionalPackage( file, new Extension[ 0 ], new Extension[ 0 ] );
  +        }
  +        else
  +        {
  +            // Determine the extensions required by this file
  +            final URL url = new URL( "jar:" + file.toURL() + "!/" );
  +            final JarURLConnection connection = (JarURLConnection)url.openConnection();
  +            final Manifest manifest = connection.getManifest();
  +            final Extension[] required = Extension.getRequired( manifest );
  +            return new OptionalPackage( file, new Extension[ 0 ], required );
           }
  -
  -        // Determine the extensions required by this file
  -        final URL url = new URL( "jar:" + file.toURL() + "!/" );
  -        final JarURLConnection connection = (JarURLConnection)url.openConnection();
  -        final Manifest manifest = connection.getManifest();
  -        final Extension[] required = Extension.getRequired( manifest );
  -        return new OptionalPackage( file, new Extension[ 0 ], required );
       }
   }
  
  
  
  1.4       +0 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/Resources.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Resources.properties	13 May 2002 09:52:30 -0000	1.3
  +++ Resources.properties	22 May 2002 07:26:25 -0000	1.4
  @@ -1,5 +1,4 @@
   no-file.error=Could not find library "{0}".
  -file-is-dir.error=Library "{0}" is a directory.
   load-library.error=Could not load Type Library "{0}".
   get-classpath-for-loader.error=Could not determine the class-path for a ClassLoader.
   create-classloader-for-files.error=Could not create a ClassLoader for {0}.
  
  
  

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


Mime
View raw message