|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.util.ResourceLoader
public class ResourceLoader
Utility class for loading or resolving external resources via URL and class path.
Constructor Summary | |
---|---|
ResourceLoader()
|
Method Summary | |
---|---|
static java.net.URL |
getClasspathResourceAsURL(java.lang.String resourceName,
java.lang.String resource)
Returns an URL from an application resource in the classpath. |
static java.net.URL |
resolveClassPathOrURLResource(java.lang.String resourceName,
java.lang.String urlOrClasspathResource)
Resolve a resource into a URL using the URL string or classpath-relative filename and using a name for any exceptions thrown. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceLoader()
Method Detail |
---|
public static java.net.URL resolveClassPathOrURLResource(java.lang.String resourceName, java.lang.String urlOrClasspathResource)
resourceName
- is the name for use in exceptionsurlOrClasspathResource
- is a URL string or classpath-relative filename
public static java.net.URL getClasspathResourceAsURL(java.lang.String resourceName, java.lang.String resource)
The method first removes the '/' character from the resource name if the first character is '/'.
The lookup order is as follows:
If a thread context class loader exists, use Thread.currentThread().getResourceAsStream to obtain an InputStream.
If no input stream was returned, use the Configuration.class.getResourceAsStream. to obtain an InputStream.
If no input stream was returned, use the Configuration.class.getClassLoader().getResourceAsStream. to obtain an InputStream.
If no input stream was returned, throw an Exception.
resourceName
- is the name for use in exceptionsresource
- is the classpath-relative filename to resolve into a URL
|
© 2006-2015 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |