Top Description Methods
org.eclipse.jetty.http.pathmap

public Interface PathSpec

extends Comparable<PathSpec>
Known Direct Implementers
org.eclipse.jetty.http.pathmap.AbstractPathSpec
Imports
java.util.Objects

A path specification is a URI path template that can be matched against.

Implementors must override Object#equals(Object) and Object#hashCode().

Method Summary

Modifier and TypeMethod and Description
public static PathSpec
from(String pathSpecString)

public String

Returns:

the as-provided path spec
getDeclaration
()

The as-provided path spec.

public PathSpecGroup

Returns:

the spec group.
getGroup
()

The spec group.

public int

Returns:

the depth of the path segments that this spec declares
getPathDepth
()

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

public String

Returns:

the path info portion of the string
getPathInfo
(String
the path to match against
path
)

Deprecated use matched(String) instead
Return the portion of the path that is after the path spec.
public String

Returns:

the match, or null if no match at all
getPathMatch
(String
the path to match against
path
)

Deprecated use matched(String) instead
Return the portion of the path that matches a path spec.
public String

Returns:

A simple prefix match for the pathspec or null
getPrefix
()

A simple prefix match for the pathspec or null

public int

Returns:

the length of the spec.
getSpecLength
()

The length of the spec.

public String

Returns:

A simple suffix match for the pathspec or null
getSuffix
()

A simple suffix match for the pathspec or null

public MatchedPath

Returns:

the matched details, if a match was possible, or null if not able to be matched.
matched
(String
the path to test
path
)

Get the complete matched details of the provided path.

public default boolean

Returns:

true if the path matches this path spec, false otherwise
matches
(String
the path to test
path
)

Test to see if the provided path matches this path spec.

Inherited from java.lang.Comparable:
compareTo

Method Detail

fromback to summary
public static PathSpec from(String pathSpecString)
getDeclarationback to summary
public String getDeclaration()

The as-provided path spec.

Returns:String

the as-provided path spec

getGroupback to summary
public PathSpecGroup getGroup()

The spec group.

Returns:PathSpecGroup

the spec group.

getPathDepthback to summary
public int 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

getPathInfoback to summary
public String getPathInfo(String path)

Deprecated

use matched(String) instead

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
getPathMatchback to summary
public String getPathMatch(String path)

Deprecated

use matched(String) instead

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
getPrefixback to summary
public String getPrefix()

A simple prefix match for the pathspec or null

Returns:String

A simple prefix match for the pathspec or null

getSpecLengthback to summary
public int getSpecLength()

The length of the spec.

Returns:int

the length of the spec.

getSuffixback to summary
public String getSuffix()

A simple suffix match for the pathspec or null

Returns:String

A simple suffix match for the pathspec or null

matchedback to summary
public MatchedPath matched(String path)

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.

See Also
matches(String)
matchesback to summary
public default boolean matches(String path)

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

See Also
matched(String)