| Modifier and Type | Method and Description |
|---|---|
static URI |
createURI(String scheme, String host, int port, String path, String query, String fragment)
已过时。
(4.2)使用
URIBuilder 。
|
static HttpHost |
extractHost(URI uri)
从给定的 URI提取目标主机。
|
static URI |
resolve(URI originalURI, HttpHost target, List<URI> redirects)
导出用于生成最后一个请求的解释(绝对)URI。
|
static URI |
resolve(URI baseURI, String reference)
针对基本URI解析URI引用。
|
static URI |
resolve(URI baseURI, URI reference)
针对基本URI解析URI引用。
|
static URI |
rewriteURI(URI uri)
创建新的 URI的方便方法,其方案,主机,端口,路径,查询取自现有的URI,丢弃任何片段或用户信息。
|
static URI |
rewriteURI(URI uri, HttpHost target)
rewriteURI(URI, HttpHost, boolean)的方便方法,始终保持片段。
|
static URI |
rewriteURI(URI uri, HttpHost target, boolean dropFragment)
一种方便的方法,用于创建一个新的 URI,其方案,主机和端口取自目标主机,但其路径,查询和片段从现有URI中获取。
|
static URI |
rewriteURIForRoute(URI uri, RouteInfo route)
一种方便的方法,可以将原始的 URI转换为指定路由所要求的相对或绝对形式。
|
@Deprecated public static URI createURI(String scheme, String host, int port, String path, String query, String fragment) throws URISyntaxException
URIBuilder 。
URI 。
应该使用这个代替URI.URI(String, String, String, int, String, String, String)或任何其他URI多参数URI构造函数。
scheme - 方案名称
host - 主机名
port - 端口号
path - 路径
query - 查询
fragment - 片段
URISyntaxException - 如果给定方案和路径,但路径是相对的,如果从给定组件构造的URI字符串违反RFC 2396,或者如果字符串的权限组件存在但不能被解析为基于服务器的权限
public static URI rewriteURI(URI uri, HttpHost target, boolean dropFragment) throws URISyntaxException
URI,其方案,主机和端口是从目标主机获取的,但是其路径,查询和片段是从现有URI中获取的。
仅当dropFragment为false时才使用该片段。
如果未明确指定路径,则设置为“/”。
uri - 包含要使用的路径,查询和片段。
target - 包含要使用的方案,主机和端口。
dropFragment - 如果片段不被复制,
dropFragment真。
URISyntaxException - 如果生成的URI无效。
public static URI rewriteURI(URI uri, HttpHost target) throws URISyntaxException
rewriteURI(URI, HttpHost, boolean)的方便方法,始终保持片段。
public static URI rewriteURI(URI uri) throws URISyntaxException
URI的方法,其方案,主机,端口,路径,查询取自现有的URI,丢弃任何片段或用户信息。
如果未明确指定路径,则设置为“/”。
如果现有URI没有片段或用户信息,并且具有路径,那么它将被未修改地返回。
uri - 原始URI。
URISyntaxException - 如果生成的URI无效。
public static URI rewriteURIForRoute(URI uri, RouteInfo route) throws URISyntaxException
URI转换为指定路由所要求的相对或绝对形式。
uri - 原始URI。
URISyntaxException - 如果生成的URI无效。
public static URI resolve(URI baseURI, String reference)
baseURI - 基本URI
reference - URI引用
public static URI resolve(URI baseURI, URI reference)
baseURI - 基本URI
reference - URI引用
public static HttpHost extractHost(URI uri)
URI中提取目标主机。
uri -
null 。
public static URI resolve(URI originalURI, HttpHost target, List<URI> redirects) throws URISyntaxException
URI 。
originalURI - 任何重定向之前的原始请求
target - 如果最后一个URI是相对的,则会针对该目标进行解析,如果不可用,
null 。
redirects - 自原始请求以来的重定向位置的收集或
null如果不可用)。
URISyntaxException
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.