Package org.pac4j.core.matching.matcher
Class PathMatcher
java.lang.Object
org.pac4j.core.matching.matcher.PathMatcher
- All Implemented Interfaces:
Matcher
Matches all request paths except whitelisted (excluded) paths.
- Since:
- 2.0.0
- Author:
- Rob Ward
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexcludeBranch
(String path) Convenience method for excluding all paths starting with a prefix e.g.excludePath
(String path) Any path exactly matching this string will be excluded.excludePaths
(String... paths) excludeRegex
(String regex) Any path matching this regex will be excluded.includePath
(String path) includePaths
(String... paths) boolean
matches
(WebContext context, SessionStore sessionStore) 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
protected void
-
Constructor Details
-
PathMatcher
public PathMatcher()
-
-
Method Details
-
excludePath
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
-
includePath
-
includePaths
-
excludeBranch
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
Any path matching this regex will be excluded.- Parameters:
regex
- the regular expression matching the paths to be excluded- Returns:
- this path matcher
-
warnRegexp
protected void warnRegexp() -
warnInclude
protected void warnInclude() -
matches
Description copied from interface:Matcher
Check if the web context matches. -
setExcludedPaths
-
setExcludedPatterns
-
setExcludedPath
-
setExcludedPattern
-