|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.util.LoaderUtils
public class LoaderUtils
ClassLoader utility methods
Constructor Summary | |
---|---|
LoaderUtils()
|
Method Summary | |
---|---|
static boolean |
classExists(java.lang.ClassLoader loader,
java.lang.String className)
Check if a classloader has a classname resource. |
static java.lang.String |
classNameToResource(java.lang.String className)
Return the resource name of a class name. |
static java.io.File |
getClassSource(java.lang.Class c)
Find the directory or jar file the class has been loaded from. |
static java.lang.ClassLoader |
getContextClassLoader()
JDK1.1 compatible access to set the context class loader. |
static java.io.File |
getResourceSource(java.lang.ClassLoader c,
java.lang.String resource)
Find the directory or a give resource has been loaded from. |
static boolean |
isContextLoaderAvailable()
Indicates if the context class loader methods are available |
static void |
setContextClassLoader(java.lang.ClassLoader loader)
Set the context classloader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoaderUtils()
Method Detail |
---|
public static void setContextClassLoader(java.lang.ClassLoader loader)
loader
- the ClassLoader to be used as the context class loader
on the current thread.public static java.lang.ClassLoader getContextClassLoader()
public static boolean isContextLoaderAvailable()
public static java.io.File getClassSource(java.lang.Class c)
c
- the class whose location is required.
public static java.io.File getResourceSource(java.lang.ClassLoader c, java.lang.String resource)
c
- the classloader to be consulted for the sourceresource
- the resource whose location is required.
public static java.lang.String classNameToResource(java.lang.String className)
className
- the name of the class to convert.
public static boolean classExists(java.lang.ClassLoader loader, java.lang.String className)
loader
- the classloader to look it.className
- the name of the class to look for.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |