Class RandomizedTextRewriteMap

  • All Implemented Interfaces:
    RewriteMap

    public class RandomizedTextRewriteMap
    extends Object
    implements RewriteMap
    Implement a map for the txt: and rnd: mod_rewrite capabilities.
    • Constructor Detail

      • RandomizedTextRewriteMap

        public RandomizedTextRewriteMap​(String txtFilePath,
                                        boolean useRandom)
        Create a map from a text file according to the mod_rewrite syntax.
        Parameters:
        txtFilePath - the text file path
        useRandom - if the map should produce random results
    • Method Detail

      • setParameters

        public String setParameters​(String params)
        Description copied from interface: RewriteMap
        Optional parameter that can be defined through the RewriteMap directive in the rewrite.config file.
        Specified by:
        setParameters in interface RewriteMap
        Parameters:
        params - the optional parameter
        Returns:
        value is currently ignored
      • lookup

        public String lookup​(String key)
        Description copied from interface: RewriteMap
        Maps a key to a replacement value.
        The method is free to return null to indicate, that the default value from the RewriteRule directive should be used.
        Specified by:
        lookup in interface RewriteMap
        Parameters:
        key - used by the actual implementation to generate a mapped value
        Returns:
        mapped value or null