Package org.wiremock.url
Interface Segment
- All Superinterfaces:
Normalisable<Segment>,org.wiremock.stringparser.ParsedString,PercentEncoded<Segment>
Represents a single segment of a path.
A path segment is a portion of a path between forward slashes. Special segments include the
empty segment, the dot segment (.), and the dot-dot segment (..) used for
relative path resolution.
Implementations must be immutable and thread-safe.
- See Also:
-
Field Summary
Fields -
Method Summary
Static MethodsMethods inherited from interface org.wiremock.url.Normalisable
isNormalForm, normaliseMethods inherited from interface org.wiremock.stringparser.ParsedString
toStringMethods inherited from interface org.wiremock.url.PercentEncoded
decode, isEmpty, length
-
Field Details
-
EMPTY
An empty path segment. -
DOT
A dot segment (.) representing the current directory. -
DOT_DOT
A dot-dot segment (..) representing the parent directory.
-
-
Method Details
-
parse
Parses a string into a path segment.- Parameters:
segment- the string to parse- Returns:
- the parsed segment
- Throws:
IllegalSegment- if the string is not a valid segment
-
encode
Encodes a string into a valid path segment with proper percent-encoding.- Parameters:
unencoded- the unencoded string- Returns:
- the encoded segment
-