Package org.eclipse.jetty.http.pathmap
Class RegexPathSpec
- java.lang.Object
-
- org.eclipse.jetty.http.pathmap.PathSpec
-
- org.eclipse.jetty.http.pathmap.RegexPathSpec
-
- All Implemented Interfaces:
java.lang.Comparable<PathSpec>
- Direct Known Subclasses:
UriTemplatePathSpec
public class RegexPathSpec extends PathSpec
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RegexPathSpec()
RegexPathSpec(java.lang.String regex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.regex.Matcher
getMatcher(java.lang.String path)
java.lang.String
getPathInfo(java.lang.String path)
Return the portion of the path that is after the path spec.java.lang.String
getPathMatch(java.lang.String path)
Return the portion of the path that matches a path spec.java.util.regex.Pattern
getPattern()
java.lang.String
getRelativePath(java.lang.String base, java.lang.String path)
Get the relative path.boolean
matches(java.lang.String path)
Test to see if the provided path matches this path spec-
Methods inherited from class org.eclipse.jetty.http.pathmap.PathSpec
compareTo, equals, getDeclaration, getGroup, getPathDepth, getPrefix, getSuffix, hashCode, toString
-
-
-
-
Method Detail
-
getMatcher
public java.util.regex.Matcher getMatcher(java.lang.String path)
-
getPathInfo
public java.lang.String getPathInfo(java.lang.String path)
Description copied from class:PathSpec
Return the portion of the path that is after the path spec.- Specified by:
getPathInfo
in classPathSpec
- Parameters:
path
- the path to match against- Returns:
- the path info portion of the string
-
getPathMatch
public java.lang.String getPathMatch(java.lang.String path)
Description copied from class:PathSpec
Return the portion of the path that matches a path spec.- Specified by:
getPathMatch
in classPathSpec
- Parameters:
path
- the path to match against- Returns:
- the match, or null if no match at all
-
getPattern
public java.util.regex.Pattern getPattern()
-
getRelativePath
public java.lang.String getRelativePath(java.lang.String base, java.lang.String path)
Description copied from class:PathSpec
Get the relative path.- Specified by:
getRelativePath
in classPathSpec
- Parameters:
base
- the base the path is relative topath
- the additional path- Returns:
- the base plus path with pathSpec portion removed
-
-