Package org.pac4j.core.matching.matcher
Class PathMatcher
- java.lang.Object
-
- org.pac4j.core.matching.matcher.PathMatcher
-
-
Constructor Summary
Constructors Constructor Description PathMatcher()
PathMatcher(java.lang.String regexpPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathMatcher
excludeBranch(java.lang.String path)
Convenience method for excluding all paths starting with a prefix e.g.PathMatcher
excludePath(java.lang.String path)
Any path exactly matching this string will be excluded.PathMatcher
excludePaths(java.lang.String... paths)
PathMatcher
excludeRegex(java.lang.String regex)
Any path matching this regex will be excluded.java.util.Set<java.lang.String>
getExcludedPaths()
java.util.Set<java.util.regex.Pattern>
getExcludedPatterns()
boolean
matches(WebContext context, SessionStore sessionStore)
Check if the web context matches.void
setExcludedPath(java.lang.String path)
void
setExcludedPaths(java.util.Collection<java.lang.String> paths)
void
setExcludedPattern(java.lang.String regularExpression)
void
setExcludedPatterns(java.util.Collection<java.lang.String> regularExpressions)
java.lang.String
toString()
protected void
warn()
-
-
-
Method Detail
-
excludePath
public PathMatcher excludePath(java.lang.String path)
Any path exactly matching this string will be excluded. Use this method if you are excluding a specific path.- Parameters:
path
- the path to be excluded- Returns:
- this path matcher
-
excludePaths
public PathMatcher excludePaths(java.lang.String... paths)
-
excludeBranch
public PathMatcher excludeBranch(java.lang.String path)
Convenience method for excluding all paths starting with a prefix e.g. "/foo" would exclude "/foo", "/foo/bar", etc.- Parameters:
path
- the prefix for the paths to be excluded- Returns:
- this path matcher
-
excludeRegex
public PathMatcher excludeRegex(java.lang.String regex)
Any path matching this regex will be excluded.- Parameters:
regex
- the regular expression matching the paths to be excluded- Returns:
- this path matcher
-
warn
protected void warn()
-
matches
public boolean matches(WebContext context, SessionStore sessionStore)
Description copied from interface:Matcher
Check if the web context matches.
-
getExcludedPaths
public java.util.Set<java.lang.String> getExcludedPaths()
-
getExcludedPatterns
public java.util.Set<java.util.regex.Pattern> getExcludedPatterns()
-
setExcludedPaths
public void setExcludedPaths(java.util.Collection<java.lang.String> paths)
-
setExcludedPatterns
public void setExcludedPatterns(java.util.Collection<java.lang.String> regularExpressions)
-
setExcludedPath
public void setExcludedPath(java.lang.String path)
-
setExcludedPattern
public void setExcludedPattern(java.lang.String regularExpression)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-