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:
Comparable<PathSpec>
- Direct Known Subclasses:
UriTemplatePathSpec
public class RegexPathSpec extends PathSpec
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRegexPathSpec()RegexPathSpec(String regex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MatchergetMatcher(String path)StringgetPathInfo(String path)Return the portion of the path that is after the path spec.StringgetPathMatch(String path)Return the portion of the path that matches a path spec.PatterngetPattern()StringgetRelativePath(String base, String path)Get the relative path.booleanmatches(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
-
-
-
-
Field Detail
-
pattern
protected Pattern pattern
-
-
Constructor Detail
-
RegexPathSpec
protected RegexPathSpec()
-
RegexPathSpec
public RegexPathSpec(String regex)
-
-
Method Detail
-
getPathInfo
public String getPathInfo(String path)
Description copied from class:PathSpecReturn the portion of the path that is after the path spec.- Specified by:
getPathInfoin classPathSpec- Parameters:
path- the path to match against- Returns:
- the path info portion of the string
-
getPathMatch
public String getPathMatch(String path)
Description copied from class:PathSpecReturn the portion of the path that matches a path spec.- Specified by:
getPathMatchin classPathSpec- Parameters:
path- the path to match against- Returns:
- the match, or null if no match at all
-
getPattern
public Pattern getPattern()
-
getRelativePath
public String getRelativePath(String base, String path)
Description copied from class:PathSpecGet the relative path.- Specified by:
getRelativePathin classPathSpec- Parameters:
base- the base the path is relative topath- the additional path- Returns:
- the base plus path with pathSpec portion removed
-
-