rewrite-config-servlet 2.0.0.Beta3

org.ocpsoft.rewrite.servlet.config
Class Resource

java.lang.Object
  extended by org.ocpsoft.rewrite.config.DefaultConditionBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpCondition
          extended by org.ocpsoft.rewrite.servlet.config.Resource
All Implemented Interfaces:
Condition, ConditionBuilder, Parameterized

public class Resource
extends HttpCondition
implements Parameterized

A Condition responsible for determining existence of resources within the ServletContext.getResourcePaths(String) of the servlet container.

Author:
Lincoln Baxter, III

Method Summary
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
static Resource exists(String resource)
          Create a Condition that returns true if the given resource exists in the ServletContext.getResourcePaths(String) of the current application.
 ParameterizedPatternParser getExpression()
          Get the ParameterizedPattern of this Resource.
 Set<String> getRequiredParameterNames()
           
 void setParameterStore(ParameterStore store)
           
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate
 
Methods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, or, orNot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

evaluateHttp

public boolean evaluateHttp(HttpServletRewrite event,
                            EvaluationContext context)
Specified by:
evaluateHttp in class HttpCondition

exists

public static Resource exists(String resource)
Create a Condition that returns true if the given resource exists in the ServletContext.getResourcePaths(String) of the current application.

The given resource path may be parameterized:

/example/{param}.html
/css/{value}.css
...

Parameters:
location - ParameterizedPattern specifying the Address of the internal resource.
See Also:
ConfigurationRuleParameterBuilder#where(String)}

getExpression

public ParameterizedPatternParser getExpression()
Get the ParameterizedPattern of this Resource.


getRequiredParameterNames

public Set<String> getRequiredParameterNames()
Specified by:
getRequiredParameterNames in interface Parameterized

setParameterStore

public void setParameterStore(ParameterStore store)
Specified by:
setParameterStore in interface Parameterized

rewrite-config-servlet 2.0.0.Beta3

Copyright © 2013 OCPsoft. All Rights Reserved.