Class ClassUtil
- java.lang.Object
-
- org.apache.directory.fortress.core.util.ClassUtil
-
public final class ClassUtil extends Object
General purpose factory uses java reflection to instantiate new Manager object.This class is called by the Manager factories:
- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
createInstance(String className)
Given a valid class name call the default constructor through reflexion and return the reference to the caller.static InputStream
resourceAsStream(String name)
Find a file on the classloader and return as InputStream.
-
-
-
Method Detail
-
createInstance
public static Object createInstance(String className) throws CfgException
Given a valid class name call the default constructor through reflexion and return the reference to the caller.- Parameters:
className
- contains fully qualified java class name to be instantiated. Must have a public default constructor to be successful.- Returns:
- reference to instantiated ManagerImpl object.
- Throws:
CfgException
- in the event of failure to instantiate.
-
resourceAsStream
public static InputStream resourceAsStream(String name) throws CfgException
Find a file on the classloader and return as InputStream.- Parameters:
name
- contains the name of the file resource.- Returns:
- handle to the InputStream
- Throws:
CfgException
- in the event resource is not found on classloader.
-
-