public class HttpURI extends Object
http://user@host:port/path/info;param?query#fragment this class
will split it into the following undecoded optional elements:
getScheme() - http:getAuthority() - //name@host:portgetHost() - hostgetPort() - portgetPath() - /path/infogetParam() - paramgetQuery() - querygetFragment() - fragment
Any parameters will be returned from getPath(), but are excluded
from the return value of getDecodedPath(). If there are multiple
parameters, the getParam() method returns only the last one.
| 构造器和说明 |
|---|
HttpURI() |
HttpURI(HttpURI uri) |
HttpURI(String uri) |
HttpURI(String scheme,
String host,
int port,
String pathQuery) |
HttpURI(String scheme,
String host,
int port,
String path,
String param,
String query,
String fragment) |
HttpURI(URI uri) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
static HttpURI |
createHttpURI(String scheme,
String host,
int port,
String path,
String param,
String query,
String fragment)
Construct a normalized URI.
|
void |
decodeQueryTo(MultiMap<String> parameters) |
void |
decodeQueryTo(MultiMap<String> parameters,
Charset encoding) |
void |
decodeQueryTo(MultiMap<String> parameters,
String encoding) |
boolean |
equals(Object o) |
String |
getAuthority() |
String |
getDecodedPath() |
String |
getFragment() |
String |
getHost() |
String |
getParam() |
String |
getPath()
The parsed Path.
|
String |
getPathQuery() |
int |
getPort() |
String |
getQuery() |
String |
getScheme() |
String |
getUser() |
boolean |
hasAuthority() |
boolean |
hasQuery() |
boolean |
isAbsolute() |
void |
parse(String uri) |
void |
parse(String uri,
int offset,
int length) |
void |
parseConnect(String uri)
已过时。
|
void |
parseRequestTarget(String method,
String uri)
Parse according to https://tools.ietf.org/html/rfc7230#section-5.3
|
void |
setAuthority(String host,
int port) |
void |
setDecodedPath(String path) |
void |
setPath(String path) |
void |
setPathQuery(String path) |
void |
setQuery(String query) |
void |
setScheme(String scheme) |
String |
toString() |
URI |
toURI() |
public HttpURI()
public HttpURI(String scheme, String host, int port, String path, String param, String query, String fragment)
public HttpURI(HttpURI uri)
public HttpURI(String uri)
public HttpURI(URI uri)
public static HttpURI createHttpURI(String scheme, String host, int port, String path, String param, String query, String fragment)
scheme - the URI schemehost - the URI hoseport - the URI portpath - the URI pathparam - the URI paramquery - the URI queryfragment - the URI fragmentpublic void parse(String uri)
public void parseRequestTarget(String method, String uri)
method - the request methoduri - the request uri@Deprecated public void parseConnect(String uri)
public void parse(String uri, int offset, int length)
public String getScheme()
public String getHost()
public int getPort()
public String getPath()
public String getDecodedPath()
public String getParam()
public String getQuery()
public boolean hasQuery()
public String getFragment()
public void decodeQueryTo(MultiMap<String> parameters, String encoding) throws UnsupportedEncodingException
public void decodeQueryTo(MultiMap<String> parameters, Charset encoding) throws UnsupportedEncodingException
public void clear()
public boolean isAbsolute()
public void setScheme(String scheme)
public void setAuthority(String host, int port)
host - the hostport - the portpublic void setPath(String path)
path - the pathpublic void setDecodedPath(String path)
path - the decoded pathpublic void setPathQuery(String path)
public void setQuery(String query)
public URI toURI() throws URISyntaxException
public String getPathQuery()
public boolean hasAuthority()
public String getAuthority()
public String getUser()
Copyright © 2016. All rights reserved.