Class RandomizedTextRewriteMap
java.lang.Object
org.apache.catalina.valves.rewrite.RandomizedTextRewriteMap
- All Implemented Interfaces:
RewriteMap
Implement a map for the txt: and rnd: mod_rewrite capabilities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringManagerStringManager for this package. -
Constructor Summary
ConstructorsConstructorDescriptionRandomizedTextRewriteMap(String txtFilePath, boolean useRandom) Create a map from a text file according to the mod_rewrite syntax. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RewriteMap
setParameters
-
Field Details
-
sm
StringManager for this package.
-
-
Constructor Details
-
RandomizedTextRewriteMap
Create a map from a text file according to the mod_rewrite syntax.- Parameters:
txtFilePath- the text file pathuseRandom- if the map should produce random results
-
-
Method Details
-
setParameters
Sets optional parameters for the map. This implementation does not support additional parameters and always throws an exception.- Specified by:
setParametersin interfaceRewriteMap- Parameters:
params- the optional parameter- Returns:
- never returns, always throws
IllegalArgumentException
-
lookup
Looks up a key in the map and returns the mapped value. If the map was created with random mode enabled and the value contains multiple options separated by '|', a random option is returned.- Specified by:
lookupin interfaceRewriteMap- Parameters:
key- the key to look up- Returns:
- the mapped value or
nullif the key is not found
-