Class ManifoldCFResourceLoader
- java.lang.Object
-
- org.apache.manifoldcf.core.system.ManifoldCFResourceLoader
-
public class ManifoldCFResourceLoader extends java.lang.ObjectAn instance of this class is capable of minting URLClassLoader objects on demand, for the purpose of loading plugins.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected java.lang.ClassLoaderclassLoaderThe class loader we're cachingprotected java.util.ArrayListcurrentClasspathThe current 'classpath' - a list of File objectsprotected java.lang.ClassLoaderparentThe parent class loader
-
Constructor Summary
Constructors Constructor Description ManifoldCFResourceLoader(java.lang.ClassLoader parent)Construct a resource manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDirsToClassPath(java.io.File[] baseList, java.io.FileFilter[] filterList)Add fully-resolved directories (with filters) to the current class path.voidaddToClassPath(java.io.File file)Add to the class-search path.voidaddToClassPath(java.io.File dir, java.io.FileFilter filter)Add to the class-search path.voidclearClassPath()Clear the class-search path.java.lang.ClassfindClass(java.lang.String cname)Get the specified class using the proper classloader.java.lang.ClassLoadergetClassLoader()Get the class loader representing this resource loader.voidsetClassPath(java.util.ArrayList libdirList)Set the classpath to a given list of libdirs.
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
parent
protected java.lang.ClassLoader parent
The parent class loader
-
classLoader
protected java.lang.ClassLoader classLoader
The class loader we're caching
-
currentClasspath
protected java.util.ArrayList currentClasspath
The current 'classpath' - a list of File objects
-
-
Constructor Detail
-
ManifoldCFResourceLoader
public ManifoldCFResourceLoader(java.lang.ClassLoader parent) throws ManifoldCFExceptionConstruct a resource manager.- Parameters:
parent- is the parent class loader.- Throws:
ManifoldCFException
-
-
Method Detail
-
setClassPath
public void setClassPath(java.util.ArrayList libdirList) throws ManifoldCFExceptionSet the classpath to a given list of libdirs.- Parameters:
libdirList- is an arraylist of File objects, each representing a directory.- Throws:
ManifoldCFException
-
clearClassPath
public void clearClassPath()
Clear the class-search path.
-
addToClassPath
public void addToClassPath(java.io.File file) throws ManifoldCFExceptionAdd to the class-search path.- Parameters:
file- is the jar or class root.- Throws:
ManifoldCFException
-
addToClassPath
public void addToClassPath(java.io.File dir, java.io.FileFilter filter) throws ManifoldCFExceptionAdd to the class-search path.- Parameters:
dir- is the directory to add.filter- is the file filter to use on that directory.- Throws:
ManifoldCFException
-
getClassLoader
public java.lang.ClassLoader getClassLoader() throws ManifoldCFExceptionGet the class loader representing this resource loader.- Throws:
ManifoldCFException
-
findClass
public java.lang.Class findClass(java.lang.String cname) throws java.lang.ClassNotFoundException, ManifoldCFExceptionGet the specified class using the proper classloader.- Parameters:
cname- is the fully-qualified class name.- Throws:
java.lang.ClassNotFoundExceptionManifoldCFException
-
addDirsToClassPath
protected void addDirsToClassPath(java.io.File[] baseList, java.io.FileFilter[] filterList) throws ManifoldCFExceptionAdd fully-resolved directories (with filters) to the current class path.- Parameters:
baseList- is the list of library directories.filterList- is the corresponding list of filters.- Throws:
ManifoldCFException
-
-