Class VFSClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
org.apache.commons.vfs.impl.VFSClassLoader

public class VFSClassLoader extends SecureClassLoader
A class loader that can load classes and resources from a search path VFS FileObjects refering both to folders and JAR files. Any FileObject of type FileType.FILE is asumed to be a JAR and is opened by creating a layered file system with the "jar" scheme.

TODO - Test this with signed Jars and a SecurityManager.

Version:
$Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Wed, 29 Nov 2006) $
Author:
Brian Olsen
See Also:
  • Constructor Details

    • VFSClassLoader

      public VFSClassLoader(FileObject file, FileSystemManager manager) throws FileSystemException
      Constructors a new VFSClassLoader for the given file.
      Parameters:
      file - the file to load the classes and resources from.
      manager - the FileManager to use when trying create a layered Jar file system.
      Throws:
      FileSystemException
    • VFSClassLoader

      public VFSClassLoader(FileObject file, FileSystemManager manager, ClassLoader parent) throws FileSystemException
      Constructors a new VFSClassLoader for the given file.
      Parameters:
      file - the file to load the classes and resources from.
      manager - the FileManager to use when trying create a layered Jar file system.
      parent - the parent class loader for delegation.
      Throws:
      FileSystemException
    • VFSClassLoader

      public VFSClassLoader(FileObject[] files, FileSystemManager manager) throws FileSystemException
      Constructors a new VFSClassLoader for the given files. The files will be searched in the order specified.
      Parameters:
      files - the files to load the classes and resources from.
      manager - the FileManager to use when trying create a layered Jar file system.
      Throws:
      FileSystemException
    • VFSClassLoader

      public VFSClassLoader(FileObject[] files, FileSystemManager manager, ClassLoader parent) throws FileSystemException
      Constructors a new VFSClassLoader for the given FileObjects. The FileObjects will be searched in the order specified.
      Parameters:
      files - the FileObjects to load the classes and resources from.
      manager - the FileManager to use when trying create a layered Jar file system.
      parent - the parent class loader for delegation.
      Throws:
      FileSystemException
  • Method Details