public class ClassLoaderUtil
extends java.lang.Object
Constructor and Description |
---|
ClassLoaderUtil() |
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
getResource(java.lang.String resourceName,
java.lang.Class callingClass)
Load a given resource.
|
static java.io.InputStream |
getResourceAsStream(java.lang.String resourceName,
java.lang.Class callingClass)
This is a convenience method to load a resource as a stream.
|
static java.lang.Class |
loadClass(java.lang.String className,
java.lang.Class callingClass)
Load a class with a given name.
|
public static java.net.URL getResource(java.lang.String resourceName, java.lang.Class callingClass)
resourceName
- The name of the resource to loadcallingClass
- The Class object of the calling objectpublic static java.io.InputStream getResourceAsStream(java.lang.String resourceName, java.lang.Class callingClass)
resourceName
- The name of the resource to loadcallingClass
- The Class object of the calling objectpublic static java.lang.Class loadClass(java.lang.String className, java.lang.Class callingClass) throws java.lang.ClassNotFoundException
className
- The name of the class to loadcallingClass
- The Class object of the calling objectjava.lang.ClassNotFoundException
- If the class cannot be found anywhere.