Top Fields Constructors Methods
org.eclipse.jetty.http.pathmap

public Class ServletPathSpec

extends AbstractPathSpec
Class Inheritance
Imports
org.eclipse.jetty.util.StringUtil, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final String
private final PathSpecGroup
private final int
private final int
private final String
private final MatchedPath
private final int
private final String
private static final Logger

Constructor Summary

AccessConstructor and Description
public
ServletPathSpec(String servletPathSpec)

Method Summary

Modifier and TypeMethod and Description
private static void
public String
public PathSpecGroup
public int
getPathDepth()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathDepth.

Get the number of path elements that this path spec declares.
public String
getPathInfo(String
the path to match against
path
)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathInfo.

Deprecated use matched(String)#MatchedPath#getPathInfo() instead.
Return the portion of the path that is after the path spec.
public String
getPathMatch(String
the path to match against
path
)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathMatch.

Return the portion of the path that matches a path spec.
public String
getPrefix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPrefix.

A simple prefix match for the pathspec or null
public int
public String
getSuffix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getSuffix.

A simple suffix match for the pathspec or null
private static boolean
private boolean
public static boolean

Returns:

true if match.
match
(String
the path spec
pathSpec
,
String
the path
path
)

public static boolean

Returns:

true if match.
match
(String
the path spec
pathSpec
,
String
the path
path
,
boolean
true to not handle the default path "/" special, false to allow matcher rules to run
noDefault
)

public MatchedPath
matched(String
the path to test
path
)

Implements org.eclipse.jetty.http.pathmap.PathSpec.matched.

Get the complete matched details of the provided path.
public boolean
matches(String
the path to test
path
)

Overrides default org.eclipse.jetty.http.pathmap.PathSpec.matches.

Test to see if the provided path matches this path spec.
public static String

Returns:

the pathSpec prefixed by '/' if appropriate
normalize
(String
the servlet or filter mapping pattern
pathSpec
)

If a servlet or filter path mapping isn't a suffix mapping, ensure it starts with '/'

public static String

Returns:

The path info string
pathInfo
(String
the path spec
pathSpec
,
String
the path
path
)

Return the portion of a path that is after a path spec.

public static String

Returns:

null if no match at all.
pathMatch
(String
the path spec
pathSpec
,
String
the path
path
)

Return the portion of a path that matches a path spec.

public static String

Returns:

base plus path with pathspec removed
relativePath
(String
The base the path is relative to.
base
,
String
The spec of the path segment to ignore.
pathSpec
,
String
the additional path
path
)

Relative path.

Inherited from org.eclipse.jetty.http.pathmap.AbstractPathSpec:
compareToequalshashCodetoString

Field Detail

_declarationback to summary
private final String _declaration
_groupback to summary
private final PathSpecGroup _group
_matchLengthback to summary
private final int _matchLength
_pathDepthback to summary
private final int _pathDepth
_prefixback to summary
private final String _prefix
_preMatchedPathback to summary
private final MatchedPath _preMatchedPath
_specLengthback to summary
private final int _specLength
_suffixback to summary
private final String _suffix
LOGback to summary
private static final Logger LOG

Constructor Detail

ServletPathSpecback to summary
public ServletPathSpec(String servletPathSpec)

Method Detail

assertValidServletPathSpecback to summary
private static void assertValidServletPathSpec(String servletPathSpec)
getDeclarationback to summary
public String getDeclaration()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getDeclaration.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getDeclaration.

The as-provided path spec.

Returns:String

the as-provided path spec

Annotations
@Override
getGroupback to summary
public PathSpecGroup getGroup()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getGroup.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getGroup.

The spec group.

Returns:PathSpecGroup

the spec group.

Annotations
@Override
getPathDepthback to summary
public int getPathDepth()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathDepth.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPathDepth.

Get the number of path elements that this path spec declares.

This is used to determine longest match logic.

Returns:int

the depth of the path segments that this spec declares

Annotations
@Override
getPathInfoback to summary
public String getPathInfo(String path)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathInfo.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPathInfo.

Return the portion of the path that is after the path spec.

Parameters
path:String

the path to match against

Returns:String

the path info portion of the string

Annotations
@Deprecated
@Override
getPathMatchback to summary
public String getPathMatch(String path)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathMatch.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPathMatch.

Return the portion of the path that matches a path spec.

Parameters
path:String

the path to match against

Returns:String

the match, or null if no match at all

Annotations
@Deprecated
@Override
getPrefixback to summary
public String getPrefix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPrefix.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPrefix.

A simple prefix match for the pathspec or null

Returns:String

A simple prefix match for the pathspec or null

Annotations
@Override
getSpecLengthback to summary
public int getSpecLength()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getSpecLength.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getSpecLength.

The length of the spec.

Returns:int

the length of the spec.

Annotations
@Override
getSuffixback to summary
public String getSuffix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getSuffix.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getSuffix.

A simple suffix match for the pathspec or null

Returns:String

A simple suffix match for the pathspec or null

Annotations
@Override
isPathWildcardMatchback to summary
private static boolean isPathWildcardMatch(String pathSpec, String path)
isWildcardMatchback to summary
private boolean isWildcardMatch(String path)
matchback to summary
public static boolean match(String pathSpec, String path)
Parameters
pathSpec:String

the path spec

path:String

the path

Returns:boolean

true if match.

matchback to summary
public static boolean match(String pathSpec, String path, boolean noDefault)
Parameters
pathSpec:String

the path spec

path:String

the path

noDefault:boolean

true to not handle the default path "/" special, false to allow matcher rules to run

Returns:boolean

true if match.

matchedback to summary
public MatchedPath matched(String path)

Implements org.eclipse.jetty.http.pathmap.PathSpec.matched.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.matched.

Get the complete matched details of the provided path.

Parameters
path:String

the path to test

Returns:MatchedPath

the matched details, if a match was possible, or null if not able to be matched.

Annotations
@Override
matchesback to summary
public boolean matches(String path)

Overrides default org.eclipse.jetty.http.pathmap.PathSpec.matches.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.matches.

Test to see if the provided path matches this path spec. This can be more efficient that matched(String) if the details of the match are not required.

Parameters
path:String

the path to test

Returns:boolean

true if the path matches this path spec, false otherwise

Annotations
@Override
normalizeback to summary
public static String normalize(String pathSpec)

If a servlet or filter path mapping isn't a suffix mapping, ensure it starts with '/'

Parameters
pathSpec:String

the servlet or filter mapping pattern

Returns:String

the pathSpec prefixed by '/' if appropriate

pathInfoback to summary
public static String pathInfo(String pathSpec, String path)

Return the portion of a path that is after a path spec.

Parameters
pathSpec:String

the path spec

path:String

the path

Returns:String

The path info string

pathMatchback to summary
public static String pathMatch(String pathSpec, String path)

Return the portion of a path that matches a path spec.

Parameters
pathSpec:String

the path spec

path:String

the path

Returns:String

null if no match at all.

relativePathback to summary
public static String relativePath(String base, String pathSpec, String path)

Relative path.

Parameters
base:String

The base the path is relative to.

pathSpec:String

The spec of the path segment to ignore.

path:String

the additional path

Returns:String

base plus path with pathspec removed