Class RewriteCond
java.lang.Object
org.apache.catalina.valves.rewrite.RewriteCond
Rewrite condition.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstract condition interface.static classLexical comparison condition.static classPattern-based condition.static classResource existence condition. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RewriteCond.ConditionThe condition.protected StringThe condition pattern.protected StringThe flags string.booleanThis makes the test case-insensitive, i.e., there is no difference between 'A-Z' and 'a-z' both in the expanded TestString and the CondPattern.booleanUse this to combine rule conditions with a local OR instead of the implicit AND.protected booleanWhether the condition is positive.protected SubstitutionThe test substitution.protected StringThe test string. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanEvaluate the condition based on the contextReturns the condition pattern.final StringReturns the flags string.Returns the matcher for the condition, if it is a pattern-based condition.Returns the test string.booleanisNocase()Returns whether the test is case-insensitive.booleanisOrnext()Returns whether to combine rule conditions with a local OR.booleanReturns whether the condition is positive.voidparse(Map<String, RewriteMap> maps) Parses the condition using the provided rewrite maps.voidsetCondPattern(String condPattern) Sets the condition pattern.final voidsetFlagsString(String flagsString) Sets the flags string.voidsetNocase(boolean nocase) Sets whether the test is case-insensitive.voidsetOrnext(boolean ornext) Sets whether to combine rule conditions with a local OR.voidsetPositive(boolean positive) Sets whether the condition is positive.voidsetTestString(String testString) Sets the test string.toString()
-
Field Details
-
testString
The test string. -
condPattern
The condition pattern. -
flagsString
The flags string. -
positive
protected boolean positiveWhether the condition is positive. -
test
The test substitution. -
condition
The condition. -
nocase
public boolean nocaseThis makes the test case-insensitive, i.e., there is no difference between 'A-Z' and 'a-z' both in the expanded TestString and the CondPattern. This flag is effective only for comparisons between TestString and CondPattern. It has no effect on filesystem and subrequest checks. -
ornext
public boolean ornextUse this to combine rule conditions with a local OR instead of the implicit AND.
-
-
Constructor Details
-
RewriteCond
public RewriteCond()Default constructor.
-
-
Method Details
-
getCondPattern
-
setCondPattern
Sets the condition pattern.- Parameters:
condPattern- the condition pattern
-
getTestString
-
setTestString
Sets the test string.- Parameters:
testString- the test string
-
getFlagsString
-
setFlagsString
Sets the flags string.- Parameters:
flagsString- the flags string
-
parse
Parses the condition using the provided rewrite maps.- Parameters:
maps- the rewrite maps
-
getMatcher
Returns the matcher for the condition, if it is a pattern-based condition.- Returns:
- the matcher, or
nullif not a pattern condition
-
toString
-
evaluate
-
isNocase
public boolean isNocase()Returns whether the test is case-insensitive.- Returns:
trueif case-insensitive
-
setNocase
public void setNocase(boolean nocase) Sets whether the test is case-insensitive.- Parameters:
nocase-trueif case-insensitive
-
isOrnext
public boolean isOrnext()Returns whether to combine rule conditions with a local OR.- Returns:
trueif OR is used
-
setOrnext
public void setOrnext(boolean ornext) Sets whether to combine rule conditions with a local OR.- Parameters:
ornext-trueif OR is used
-
isPositive
public boolean isPositive()Returns whether the condition is positive.- Returns:
trueif positive
-
setPositive
public void setPositive(boolean positive) Sets whether the condition is positive.- Parameters:
positive-trueif positive
-