|
Hilbert II - Version 0.03.08 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.qedeq.kernel.utility.ResourceLoaderUtility
Utility methods for accessing classes and resources using an appropriate class loader. Adapted from org.apache.myfaces.trinidad.util.ClassLoaderUtils.
| Method Summary | |
static ClassLoader |
getContextClassLoader()
Dynamically accesses the current context class loader. |
static InputStream |
getResourceAsStream(String name)
Locates the stream resource with the specified name. |
static InputStream |
getResourceAsStream(String name,
ClassLoader callerClassLoader)
Locates the resource stream with the specified name. |
static URL |
getResourceUrl(File startDirectory,
String resourceDirectoryName,
String resourceName)
Get resource URL. |
static URL |
getResourceUrl(String name)
Locates the resource with the specified name. |
static URL |
getResourceUrl(String name,
ClassLoader callerClassLoader)
Locates the resource with the specified name. |
static Class |
loadClass(String name)
Loads the class with the specified name. |
static Class |
loadClass(String name,
ClassLoader callerClassLoader)
Loads the class with the specified name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static Class loadClass(String name)
throws ClassNotFoundException
name - Name of class to load.
Class object
ClassNotFoundException - Class was not found.public static URL getResourceUrl(String name)
name - Resource name.
URL object. Maybe null.public static InputStream getResourceAsStream(String name)
name - the name of the resource
InputStream object
public static Class loadClass(String name,
ClassLoader callerClassLoader)
throws ClassNotFoundException
name - the name of the classcallerClassLoader - the calling class loader context
Class object
ClassNotFoundException - if the class was not found
public static URL getResourceUrl(String name,
ClassLoader callerClassLoader)
name - the name of the resourcecallerClassLoader - the calling class loader context
URL object
public static InputStream getResourceAsStream(String name,
ClassLoader callerClassLoader)
name - the name of the resourcecallerClassLoader - the calling class loader context
InputStream objectpublic static ClassLoader getContextClassLoader()
null if there is
no per-thread context class loader. Also if the JRE is below 1.2 or something else went wrong
the method returns null.
public static URL getResourceUrl(File startDirectory,
String resourceDirectoryName,
String resourceName)
startDirectory - Start looking from this directory.resourceDirectoryName - Within this directory
(relative to startDirectory).resourceName - Look for this resource file.
|
Hilbert II - Version 0.03.08 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ©left GNU General Public Licence All Rights Reserved. |