Package org.pac4j.core.matching.matcher
Class PathMatcher
- java.lang.Object
-
- org.pac4j.core.matching.matcher.PathMatcher
-
-
Constructor Summary
Constructors Constructor Description PathMatcher()
PathMatcher(String regexpPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathMatcher
excludeBranch(String path)
Convenience method for excluding all paths starting with a prefix e.g.PathMatcher
excludePath(String path)
Any path exactly matching this string will be excluded.PathMatcher
excludePaths(String... paths)
PathMatcher
excludeRegex(String regex)
Any path matching this regex will be excluded.Set<String>
getExcludedPaths()
Set<Pattern>
getExcludedPatterns()
boolean
matches(WebContext context)
Check if the web context matches.void
setExcludedPath(String path)
void
setExcludedPaths(Collection<String> paths)
void
setExcludedPattern(String regularExpression)
void
setExcludedPatterns(Collection<String> regularExpressions)
protected void
warn()
-
-
-
Constructor Detail
-
PathMatcher
public PathMatcher()
-
PathMatcher
public PathMatcher(String regexpPath)
-
-
Method Detail
-
excludePath
public PathMatcher excludePath(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(String... paths)
-
excludeBranch
public PathMatcher excludeBranch(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(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)
Description copied from interface:Matcher
Check if the web context matches.
-
setExcludedPaths
public void setExcludedPaths(Collection<String> paths)
-
setExcludedPatterns
public void setExcludedPatterns(Collection<String> regularExpressions)
-
setExcludedPath
public void setExcludedPath(String path)
-
setExcludedPattern
public void setExcludedPattern(String regularExpression)
-
-