当前页面:
在线文档首页 >
JBoss JBPM 3.1.3 API 英文版文档
ClassLoaderUtil (jbpm-3.1.3) - JBoss JBPM 3.1.3 API 英文版文档
org.jbpm.util
Class ClassLoaderUtil
java.lang.Object
org.jbpm.util.ClassLoaderUtil
public class ClassLoaderUtil
- extends java.lang.Object
provides centralized classloader lookup.
Method Summary |
static java.lang.ClassLoader |
getClassLoader()
|
static java.lang.ClassLoader |
getProcessClassLoader(ProcessDefinition processDefinition)
searches the given resource, first on the root of the classpath and if not
not found there, in the given directory. |
static java.util.Properties |
getProperties(java.lang.String resource)
|
static java.io.InputStream |
getStream(java.lang.String resource)
|
static java.lang.Class |
loadClass(java.lang.String className)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassLoaderUtil
public ClassLoaderUtil()
loadClass
public static java.lang.Class loadClass(java.lang.String className)
getClassLoader
public static java.lang.ClassLoader getClassLoader()
getStream
public static java.io.InputStream getStream(java.lang.String resource)
getProperties
public static java.util.Properties getProperties(java.lang.String resource)
getProcessClassLoader
public static java.lang.ClassLoader getProcessClassLoader(ProcessDefinition processDefinition)
- searches the given resource, first on the root of the classpath and if not
not found there, in the given directory.
public static InputStream getStream(String resource, String directory) {
InputStream is = getClassLoader().getResourceAsStream(resource);
if (is==null) {
is = getClassLoader().getResourceAsStream(directory+"/"+resource);
}
return is;
}
public static Properties getProperties(String resource, String directory) {
Properties properties = new Properties();
try {
properties.load(getStream(resource, directory));
} catch (IOException e) {
throw new JbpmException("couldn't load properties file '"+resource+"'", e);
}
return properties;
}
Version : jbpm-3.1.3