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