|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.isdc.wro.model.resource.locator.wildcard.WildcardUriLocatorSupport ro.isdc.wro.model.resource.locator.ServletContextUriLocator
public class ServletContextUriLocator
UriLocator capable to read the resources relative to servlet context. The resource reader will attempt to locate a physic resource under the servlet context and if the resource does not exist, will try to use requestDispatcher. This kind of resources will be accepted if their prefix is '/'.
Nested Class Summary | |
---|---|
static class |
ServletContextUriLocator.LocatorStrategy
Available LocatorStrategies. |
Field Summary | |
---|---|
static String |
ALIAS
Alias used to register this locator with LocatorProvider . |
static String |
ALIAS_DISPATCHER_FIRST
Same as default Alias (exist for explicit configuration). |
static String |
ALIAS_SERVLET_CONTEXT_FIRST
Uses SERVLET_CONTEXT_FIRST strategy, meaning that, for example, a jsp will be served with its raw content, instead of processed by container. |
static String |
PREFIX
Prefix for url resources. |
Constructor Summary | |
---|---|
ServletContextUriLocator()
|
Method Summary | |
---|---|
boolean |
accept(String uri)
Check if this uri can be located by concrete implementation. |
static boolean |
isProtectedResource(String uri)
Check If the uri of the resource is protected: it cannot be accessed by accessing the url directly (WEB-INF folder). |
static boolean |
isValid(String uri)
Check if a uri is a servletContext resource. |
InputStream |
locate(String uri)
Locates the uri by retrieving the InputStream. |
ServletContextUriLocator |
setLocatorStrategy(ServletContextUriLocator.LocatorStrategy locatorStrategy)
Sets the locator strategy to use. |
Methods inherited from class ro.isdc.wro.model.resource.locator.wildcard.WildcardUriLocatorSupport |
---|
getWildcardStreamLocator, isEnableWildcards, newWildcardStreamLocator, setEnableWildcards |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ALIAS
LocatorProvider
.
public static final String ALIAS_DISPATCHER_FIRST
public static final String ALIAS_SERVLET_CONTEXT_FIRST
public static final String PREFIX
Constructor Detail |
---|
public ServletContextUriLocator()
Method Detail |
---|
public ServletContextUriLocator setLocatorStrategy(ServletContextUriLocator.LocatorStrategy locatorStrategy)
public boolean accept(String uri)
uri
- to read.
public static boolean isValid(String uri)
uri
- to check.
public static boolean isProtectedResource(String uri)
uri
- the uri to check.
public InputStream locate(String uri) throws IOException
uri
- uri to read.
IOException
- if the resource cannot be read for some reason.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |