Package org.eclipse.jetty.http
Class HttpURI.Mutable
java.lang.Object
org.eclipse.jetty.http.HttpURI.Mutable
- All Implemented Interfaces:
HttpURI
- Enclosing interface:
- HttpURI
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.http.HttpURI
HttpURI.Immutable, HttpURI.Mutable, HttpURI.Unsafe -
Method Summary
Modifier and TypeMethodDescriptionasString()clear()Clears all URI components, resetting this mutable to an empty state.decodedPath(String path) Sets the path from a decoded (non-percent-encoded) string.booleangetHost()getParam()Get a URI path parameter.getPath()intgetPort()getQuery()getUser()booleaninthashCode()booleanhasViolation(UriCompliance.Violation violation) booleanChecks if the URI has any compliance violations against the URI specification or best practices.booleanbooleanChecks if the URI contains any ambiguous path violations that could be interpreted differently by different URI parsers.Normalizes the URI by removing the default port if it matches the scheme's default port.Sets the path parameter, appending it to the path after a semicolon.Sets the path and query from a combined string in the formpath?query.port(int port) scheme(HttpScheme scheme) toString()Parses and sets all URI components from a string.Parses and sets all URI components from a substring.Parses and sets URI components from a string, handling HTTP method-specific parsing.Sets all URI components from anotherHttpURI.Sets the user info component of the URI authority.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.http.HttpURI
hasAmbiguousEmptySegment, hasAmbiguousEncoding, hasAmbiguousParameter, hasAmbiguousSegment, hasAmbiguousSeparator, hasUtf16Encoding, toURI
-
Method Details
-
asImmutable
- Specified by:
asImmutablein interfaceHttpURI- Returns:
- An immutable copy of this HttpURI.
-
asString
-
authority
- Parameters:
host- the hostport- the port- Returns:
- this mutable
-
authority
- Parameters:
hostPort- the host and port combined- Returns:
- this mutable
-
clear
Clears all URI components, resetting this mutable to an empty state.- Returns:
- this mutable for chaining.
-
decodedPath
Sets the path from a decoded (non-percent-encoded) string.- Parameters:
path- The decoded path to set.- Returns:
- this mutable for chaining.
-
equals
-
fragment
- Parameters:
fragment- The fragment to set.- Returns:
- this mutable for chaining.
-
getAuthority
- Specified by:
getAuthorityin interfaceHttpURI- Returns:
- The authority component of the URI in the form
host:port, or justhostif the port is not set, ornullif no host is set.
-
getDecodedPath
- Specified by:
getDecodedPathin interfaceHttpURI- Returns:
- The decoded path with percent-encoded characters decoded, or
nullif no path is set. - See Also:
-
getCanonicalPath
- Specified by:
getCanonicalPathin interfaceHttpURI- Returns:
- The canonical path with path parameters removed and percent-encoded characters decoded,
or
nullif no path is set. - See Also:
-
getFragment
- Specified by:
getFragmentin interfaceHttpURI- Returns:
- The fragment component of the URI (after the
#character), ornullif not set.
-
getHost
-
getParam
Description copied from interface:HttpURIGet a URI path parameter.
Path parameters were defined in RFC 2068 and appear after a semicolon in the path, such as
/path;param. This is distinct from query parameters which appear after the?character. -
getPath
-
getPathQuery
- Specified by:
getPathQueryin interfaceHttpURI- Returns:
- The raw, undecoded, path and query components combined as
path?query, or just the path if no query is present, ornullif no path is set.
-
getPort
public int getPort() -
getQuery
-
getScheme
-
getUser
-
hasAuthority
public boolean hasAuthority()- Specified by:
hasAuthorityin interfaceHttpURI- Returns:
trueif the URI has an authority component.
-
hashCode
public int hashCode() -
host
- Parameters:
host- The host to set.- Returns:
- this mutable for chaining.
- Throws:
IllegalArgumentException- if a relative path is set with an authority.
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolutein interfaceHttpURI- Returns:
trueif the URI has a scheme component.
-
isAmbiguous
public boolean isAmbiguous()Description copied from interface:HttpURIChecks if the URI contains any ambiguous path violations that could be interpreted differently by different URI parsers.
- Specified by:
isAmbiguousin interfaceHttpURI- Returns:
trueif the URI has any ambiguousUriCompliance.Violations.- See Also:
-
hasViolations
public boolean hasViolations()Description copied from interface:HttpURIChecks if the URI has any compliance violations against the URI specification or best practices.
- Specified by:
hasViolationsin interfaceHttpURI- Returns:
trueif the URI has anyUriCompliance.Violations.- See Also:
-
hasViolation
- Specified by:
hasViolationin interfaceHttpURI- Parameters:
violation- The violation to check.- Returns:
trueif the URI has the specified violation.- See Also:
-
getViolations
- Specified by:
getViolationsin interfaceHttpURI- Returns:
- The set of
UriCompliance.Violations detected in the URI, or an empty set if none. - See Also:
-
normalize
Normalizes the URI by removing the default port if it matches the scheme's default port.- Returns:
- this mutable for chaining.
-
param
Sets the path parameter, appending it to the path after a semicolon.- Parameters:
param- The path parameter to set.- Returns:
- this mutable for chaining.
-
path
- Parameters:
path- the path- Returns:
- this Mutable
-
pathQuery
Sets the path and query from a combined string in the formpath?query.- Parameters:
pathQuery- The path and query string to set.- Returns:
- this mutable for chaining.
- Throws:
IllegalArgumentException- if a relative path is set with an authority.
-
port
- Parameters:
port- The port to set, or-1to clear the port.- Returns:
- this mutable for chaining.
-
query
- Parameters:
query- The query string to set.- Returns:
- this mutable for chaining.
-
scheme
- Parameters:
scheme- TheHttpSchemeto set.- Returns:
- this mutable for chaining.
-
scheme
- Parameters:
scheme- The scheme to set, which will be normalized to lower-case.- Returns:
- this mutable for chaining.
-
toString
-
uri
Sets all URI components from anotherHttpURI.- Parameters:
uri- The URI to copy components from.- Returns:
- this mutable for chaining.
-
uri
Parses and sets all URI components from a string.- Parameters:
uri- The URI string to parse.- Returns:
- this mutable for chaining.
-
uri
Parses and sets URI components from a string, handling HTTP method-specific parsing.- Parameters:
method- The HTTP method, which affects parsing for CONNECT requests.uri- The URI string to parse.- Returns:
- this mutable for chaining.
-
uri
Parses and sets all URI components from a substring.- Parameters:
uri- The string containing the URI.offset- The offset within the string where the URI starts.length- The length of the URI substring.- Returns:
- this mutable for chaining.
-
user
Sets the user info component of the URI authority.- Parameters:
user- The user info to set, ornullto clear it.- Returns:
- this mutable for chaining.
-