org.loom.util
Class UrlMatcher

java.lang.Object
  extended by org.loom.util.UrlMatcher

public class UrlMatcher
extends java.lang.Object

Hold a list of patterns that can be matched against a URL to get if they match or not. By default it recognizes filenames with version numbers in it, given that it does not include "SNAPSHOT" in its name.


Constructor Summary
UrlMatcher()
           
UrlMatcher(java.lang.String[] include, java.lang.String[] exclude)
           
 
Method Summary
 boolean matches(javax.servlet.http.HttpServletRequest request)
          Return true if the request URI (without parameters) resolves as a match
 boolean matches(java.lang.String uri)
           
 void setExclude(java.util.List<java.util.regex.Pattern> exclude)
           
 void setExclude(java.lang.String[] exclude)
           
 void setInclude(java.util.List<java.util.regex.Pattern> include)
           
 void setInclude(java.lang.String[] include)
           
static java.util.List<java.util.regex.Pattern> toPatterns(java.lang.String... patterns)
          Set the list of regex patterns that would resolve as a match
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlMatcher

public UrlMatcher()

UrlMatcher

public UrlMatcher(java.lang.String[] include,
                  java.lang.String[] exclude)
Method Detail

toPatterns

public static java.util.List<java.util.regex.Pattern> toPatterns(java.lang.String... patterns)
Set the list of regex patterns that would resolve as a match

Parameters:
patterns -

matches

public boolean matches(javax.servlet.http.HttpServletRequest request)
Return true if the request URI (without parameters) resolves as a match


matches

public boolean matches(java.lang.String uri)

setInclude

public void setInclude(java.util.List<java.util.regex.Pattern> include)

setExclude

public void setExclude(java.util.List<java.util.regex.Pattern> exclude)

setInclude

public void setInclude(java.lang.String[] include)

setExclude

public void setExclude(java.lang.String[] exclude)