| java.lang.Object org.apache.velocity.util.ClassUtils
ClassUtils | public class ClassUtils (Code) | | Simple utility functions for manipulating classes and resources
from the classloader.
author: Will Glass-Husain version: $Id: ClassUtils.java 463298 2006-10-12 16:10:32Z henning $ |
getClass | public static Class getClass(String clazz) throws ClassNotFoundException(Code) | | Return the specified class. Checks the ThreadContext classloader first,
then uses the System classloader. Should replace all calls to
Class.forName( claz ) (which only calls the System class
loader) when the class might be in a different classloader (e.g. in a
webapp).
Parameters: clazz - the name of the class to instantiate the requested Class object throws: ClassNotFoundException - |
getResourceAsStream | public static InputStream getResourceAsStream(Class claz, String name)(Code) | | Finds a resource with the given name. Checks the Thread Context
classloader, then uses the System classloader. Should replace all
calls to Class.getResourceAsString when the resource
might come from a different classloader. (e.g. a webapp).
Parameters: claz - Class to use when getting the System classloader (used if no ThreadContext classloader available or fails to get resource). Parameters: name - name of the resource InputStream for the resource. |
|
|