|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.reflections.util.ClasspathHelper
public abstract class ClasspathHelper
Some classpath convenient methods
Field Summary | |
---|---|
static ClassLoader[] |
defaultClassLoaders
|
Constructor Summary | |
---|---|
ClasspathHelper()
|
Method Summary | |
---|---|
static ClassLoader[] |
classLoaders(ClassLoader... classLoaders)
returns given classLoaders, if not null, otherwise defaults to both getContextClassLoader() and getStaticClassLoader() |
static URL |
forClass(Class<?> aClass,
ClassLoader... classLoaders)
returns the url that contains the given class, using ClassLoader.getResource(String) |
static Set<URL> |
forClassLoader(ClassLoader... classLoaders)
returns urls using URLClassLoader.getURLs() up the classloader parent hierarchy |
static Set<URL> |
forJavaClassPath()
returns urls using java.class.path system property |
static Set<URL> |
forManifest()
return urls that are in the current class path. |
static Set<URL> |
forManifest(Iterable<URL> urls)
get the urls that are specified in the manifest of the given urls. |
static Set<URL> |
forManifest(URL url)
get the urls that are specified in the manifest of the given url for a jar file. |
static Set<URL> |
forPackage(String name,
ClassLoader... classLoaders)
returns urls with resources of package starting with given name, using ClassLoader.getResources(String) |
static URL |
forWebInfClasses(javax.servlet.ServletContext servletContext)
returns url using ServletContext in resource path WEB-INF/classes |
static Set<URL> |
forWebInfLib(javax.servlet.ServletContext servletContext)
returns urls using ServletContext in resource path WEB-INF/lib |
static ClassLoader |
getContextClassLoader()
returns Thread.currentThread().getContextClassLoader() |
static ClassLoader |
getStaticClassLoader()
returns Reflections.class.getClassLoader() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static ClassLoader[] defaultClassLoaders
Constructor Detail |
---|
public ClasspathHelper()
Method Detail |
---|
public static ClassLoader getContextClassLoader()
Thread.currentThread().getContextClassLoader()
public static ClassLoader getStaticClassLoader()
Reflections.class.getClassLoader()
public static ClassLoader[] classLoaders(ClassLoader... classLoaders)
getContextClassLoader()
and getStaticClassLoader()
public static Set<URL> forPackage(String name, ClassLoader... classLoaders)
ClassLoader.getResources(String)
that is, forPackage("org.reflections") effectively returns urls from classpath with packages starting with org.reflections
if optional ClassLoader
s are not specified, then both getContextClassLoader()
and getStaticClassLoader()
are used for ClassLoader.getResources(String)
public static URL forClass(Class<?> aClass, ClassLoader... classLoaders)
ClassLoader.getResource(String)
if optional ClassLoader
s are not specified, then either getContextClassLoader()
or getStaticClassLoader()
are used for ClassLoader.getResources(String)
public static Set<URL> forClassLoader(ClassLoader... classLoaders)
URLClassLoader.getURLs()
up the classloader parent hierarchy
if optional ClassLoader
s are not specified, then both getContextClassLoader()
and getStaticClassLoader()
are used for ClassLoader.getResources(String)
public static Set<URL> forJavaClassPath()
java.class.path
system property
public static Set<URL> forWebInfLib(javax.servlet.ServletContext servletContext)
ServletContext
in resource path WEB-INF/lib
public static URL forWebInfClasses(javax.servlet.ServletContext servletContext)
ServletContext
in resource path WEB-INF/classes
public static Set<URL> forManifest()
public static Set<URL> forManifest(URL url)
public static Set<URL> forManifest(Iterable<URL> urls)
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |