public class ClasspathUrlExtender extends Object
buildURL(URL, String) method must be used to
construct a URL for a resource on the classpath, and the setClassLoader(ClassLoader) method must first be
used to set the classloader if it differs from the classloader used for loading this class.| Modifier and Type | Class and Description |
|---|---|
static class |
ClasspathUrlExtender.ClasspathHandler
Handler for opening a connection to a resource from the classpath.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASSPATH_PROTOCOL
Protocol name for classpath access.
|
| Constructor and Description |
|---|
ClasspathUrlExtender() |
| Modifier and Type | Method and Description |
|---|---|
static URL |
buildURL(URL base,
String path)
Construct a URL which may represent a resource from the classpath.
|
static boolean |
isClasspathUrl(String url)
Check if a URL string represents a resource from the classpath.
|
static void |
setClassLoader(ClassLoader loader)
Set the classloader to be used for accessing resources.
|
public static final String CLASSPATH_PROTOCOL
public static void setClassLoader(ClassLoader loader)
loader - Classloaderpublic static boolean isClasspathUrl(String url)
url - URLtrue if classpath resource, false if notpublic static URL buildURL(URL base, String path) throws MalformedURLException
base - URL base for relative referencespath - resource pathMalformedURLException - if not a valid URL formatCopyright © 2005–2016 jibx.org. All rights reserved.