adammurdoch    2002/11/22 15:55:45

  Modified:    vfs/src/java/org/apache/commons/vfs/impl VFSClassLoader.java
  Log:
  Added a couple of convenience construtors.
  
  Revision  Changes    Path
  1.9       +42 -8     
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/VFSClassLoader.java
  
  Index: VFSClassLoader.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/VFSClassLoader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- VFSClassLoader.java       1 Nov 2002 03:24:03 -0000       1.8
  +++ VFSClassLoader.java       22 Nov 2002 23:55:45 -0000      1.9
  @@ -95,10 +95,45 @@
       private final ArrayList resources = new ArrayList();
   
       /**
  -     * Constructors a new VFSClassLoader for the given FileObjects.
  -     * The FileObjects will be searched in the order specified.
  +     * Constructors a new VFSClassLoader for the given file.
        *
  -     * @param files the FileObjects to load the classes and resources from.
  +     * @param file the file to load the classes and resources from.
  +     *
  +     * @param manager
  +     *      the FileManager to use when trying create a layered Jar file
  +     *      system.
  +     */
  +    public VFSClassLoader( final FileObject file,
  +                           final FileSystemManager manager )
  +        throws FileSystemException
  +    {
  +        this( new FileObject[] { file }, manager, null );
  +    }
  +
  +    /**
  +     * Constructors a new VFSClassLoader for the given file.
  +     *
  +     * @param file the file to load the classes and resources from.
  +     *
  +     * @param manager
  +     *      the FileManager to use when trying create a layered Jar file
  +     *      system.
  +     *
  +     * @param parent the parent class loader for delegation.
  +     */
  +    public VFSClassLoader( final FileObject file,
  +                           final FileSystemManager manager,
  +                           final ClassLoader parent )
  +        throws FileSystemException
  +    {
  +        this( new FileObject[] { file }, manager, parent );
  +    }
  +
  +    /**
  +     * Constructors a new VFSClassLoader for the given files.  The files will
  +     * be searched in the order specified.
  +     *
  +     * @param files the files to load the classes and resources from.
        *
        * @param manager
        *      the FileManager to use when trying create a layered Jar file
  @@ -108,8 +143,7 @@
                              final FileSystemManager manager )
           throws FileSystemException
       {
  -        super();
  -        addFileObjects( manager, files );
  +        this( files, manager, null );
       }
   
       /**
  @@ -138,8 +172,8 @@
        *
        * @param files the FileObjects to append to the search path.
        */
  -    protected void addFileObjects( final FileSystemManager manager,
  -                                   final FileObject[] files ) throws 
FileSystemException
  +    private void addFileObjects( final FileSystemManager manager,
  +                                 final FileObject[] files ) throws 
FileSystemException
       {
           for ( int i = 0; i < files.length; i++ )
           {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to