public class ClasspathUriLocator extends WildcardUriLocatorSupport
UriLocator that is able to read a resource from a classpath.| Modifier and Type | Field and Description |
|---|---|
static String |
ALIAS
Alias used to register this locator with
LocatorProvider. |
static String |
PREFIX
Prefix of the resource uri used to check if the resource can be read by this
UriLocator implementation. |
| Constructor and Description |
|---|
ClasspathUriLocator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(String url)
Check if this uri can be located by concrete implementation.
|
static String |
createUri(String path) |
static boolean |
isValid(String uri)
Check if a uri is a classpath resource.
|
InputStream |
locate(String uri)
Locates the uri by retrieving the InputStream.
|
WildcardStreamLocator |
newWildcardStreamLocator()
Builds a
JarWildcardStreamLocator in order to get resources from the full classpath. |
getWildcardStreamLocator, isEnableWildcards, setEnableWildcardspublic static final String ALIAS
LocatorProvider.public static final String PREFIX
UriLocator implementation.public static String createUri(String path)
public boolean accept(String url)
url - to read.public static boolean isValid(String uri)
uri - to check.public InputStream locate(String uri) throws IOException
uri - uri to read.IOException - if the resource cannot be read for some reason.public WildcardStreamLocator newWildcardStreamLocator()
JarWildcardStreamLocator in order to get resources from the full classpath.newWildcardStreamLocator in class WildcardUriLocatorSupportWildcardStreamLocator.Copyright © 2008-2014. All Rights Reserved.