Class RandomizedTextRewriteMap
- java.lang.Object
-
- org.apache.catalina.valves.rewrite.RandomizedTextRewriteMap
-
- All Implemented Interfaces:
RewriteMap
public class RandomizedTextRewriteMap extends java.lang.Object implements RewriteMap
Implement a map for the txt: and rnd: mod_rewrite capabilities.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringManagersmStringManager for this package.
-
Constructor Summary
Constructors Constructor Description RandomizedTextRewriteMap(java.lang.String txtFilePath, boolean useRandom)Create a map from a text file according to the mod_rewrite syntax.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringlookup(java.lang.String key)Looks up a key in the map and returns the mapped value.java.lang.StringsetParameters(java.lang.String params)Sets optional parameters for the map.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.catalina.valves.rewrite.RewriteMap
setParameters
-
-
-
-
Field Detail
-
sm
protected static final StringManager sm
StringManager for this package.
-
-
Method Detail
-
setParameters
public java.lang.String setParameters(java.lang.String params)
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
public java.lang.String lookup(java.lang.String key)
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
-
-