Package ai.vespa.http
Class HttpURL.Path
java.lang.Object
ai.vespa.http.HttpURL.Path
- Enclosing class:
- HttpURL
-
Method Summary
Modifier and TypeMethodDescriptionappend
(HttpURL.Path other) Returns a copy of this all segments of the other path appended, with a trailing slash as per the appendage.Returns a copy of this with the decoded segment appended at the end; it may not be either of""
,"."
or".."
.Returns a copy of this all given segments appended, with a trailing slash as per this path.cut
(int count) Returns a copy of this where the last segments are cut off, and with a trailing slash.static HttpURL.Path
empty()
Creates a new, empty path, with a trailing slash, usingHttpURL.requirePathSegment(java.lang.String)
for segment validation.static HttpURL.Path
Creates a new, empty path, with a trailing slash, using the indicated validator for segments.boolean
int
hashCode()
boolean
Whether this path has a trailing slash.head
(int count) Returns a copy of this where only the first segments are retained, and with a trailing slash.int
length()
The number of segments in this path.static HttpURL.Path
Parses the given raw, normalized path string; this ignores whether the path is absolute or relative.static HttpURL.Path
Parses the given raw, normalized path string; this ignores whether the path is absolute or relative.segments()
A mutable copy of the URL decoded segments that make up this path; nevernull
,""
,"."
or".."
.skip
(int count) Returns a copy of this where the first segments are skipped.tail
(int count) Returns a copy of this where only the last segments are retained.toString()
Intentionally not usable for constructing new URIs.Returns a copy of this which does not encode a trailing slash.Returns a copy of this which encodes a trailing slash.
-
Method Details
-
empty
Creates a new, empty path, with a trailing slash, usingHttpURL.requirePathSegment(java.lang.String)
for segment validation. -
empty
Creates a new, empty path, with a trailing slash, using the indicated validator for segments. -
parse
Parses the given raw, normalized path string; this ignores whether the path is absolute or relative. -
parse
Parses the given raw, normalized path string; this ignores whether the path is absolute or relative. -
head
Returns a copy of this where only the first segments are retained, and with a trailing slash. -
tail
Returns a copy of this where only the last segments are retained. -
skip
Returns a copy of this where the first segments are skipped. -
cut
Returns a copy of this where the last segments are cut off, and with a trailing slash. -
append
Returns a copy of this with the decoded segment appended at the end; it may not be either of""
,"."
or".."
. -
append
Returns a copy of this all segments of the other path appended, with a trailing slash as per the appendage. -
append
Returns a copy of this all given segments appended, with a trailing slash as per this path. -
hasTrailingSlash
public boolean hasTrailingSlash()Whether this path has a trailing slash. -
withTrailingSlash
Returns a copy of this which encodes a trailing slash. -
withoutTrailingSlash
Returns a copy of this which does not encode a trailing slash. -
segments
A mutable copy of the URL decoded segments that make up this path; nevernull
,""
,"."
or".."
. -
length
public int length()The number of segments in this path. -
toString
Intentionally not usable for constructing new URIs. UseHttpURL
for that instead. -
equals
-
hashCode
public int hashCode()
-