public class URIUtils
extends java.lang.Object
URIs, to workaround
bugs within the class or for ease-of-use features.| Modifier and Type | Method and Description |
|---|---|
static java.net.URI |
create(HttpHost host,
java.lang.String path)
Deprecated.
Use
URIBuilder. |
static java.net.URI |
create(java.lang.String scheme,
URIAuthority host,
java.lang.String path)
Deprecated.
Use
URIBuilder. |
static HttpHost |
extractHost(java.net.URI uri)
Extracts target host from the given
URI. |
static java.net.URI |
resolve(java.net.URI originalURI,
HttpHost target,
java.util.List<java.net.URI> redirects)
Derives the interpreted (absolute) URI that was used to generate the last
request.
|
static java.net.URI |
resolve(java.net.URI baseURI,
java.lang.String reference)
Resolves a URI reference against a base URI.
|
static java.net.URI |
resolve(java.net.URI baseURI,
java.net.URI reference)
Resolves a URI reference against a base URI.
|
static java.net.URI |
rewriteURI(java.net.URI uri)
Deprecated.
Use
URIBuilder. |
static java.net.URI |
rewriteURI(java.net.URI uri,
HttpHost target)
Deprecated.
Use
URIBuilder. |
static java.net.URI |
rewriteURI(java.net.URI uri,
HttpHost target,
boolean dropFragment)
Deprecated.
Use
URIBuilder. |
@Deprecated
public static java.net.URI rewriteURI(java.net.URI uri,
HttpHost target,
boolean dropFragment)
throws java.net.URISyntaxException
URIBuilder.URI whose scheme, host
and port are taken from the target host, but whose path, query and
fragment are taken from the existing URI. The fragment is only used if
dropFragment is false. The path is set to "/" if not explicitly specified.uri - Contains the path, query and fragment to use.target - Contains the scheme, host and port to use.dropFragment - True if the fragment should not be copied.java.net.URISyntaxException - If the resulting URI is invalid.@Deprecated
public static java.net.URI rewriteURI(java.net.URI uri,
HttpHost target)
throws java.net.URISyntaxException
URIBuilder.rewriteURI(URI, HttpHost, boolean) that always keeps the
fragment.java.net.URISyntaxException@Deprecated
public static java.net.URI rewriteURI(java.net.URI uri)
throws java.net.URISyntaxException
URIBuilder.URI whose scheme, host, port, path,
query are taken from the existing URI, dropping any fragment or user-information.
The path is set to "/" if not explicitly specified. The existing URI is returned
unmodified if it has no fragment or user-information and has a path.uri - original URI.java.net.URISyntaxException - If the resulting URI is invalid.public static java.net.URI resolve(java.net.URI baseURI,
java.lang.String reference)
baseURI - the base URIreference - the URI referencepublic static java.net.URI resolve(java.net.URI baseURI,
java.net.URI reference)
baseURI - the base URIreference - the URI referencepublic static HttpHost extractHost(java.net.URI uri)
URI.uri - null if the URI is
relative or does not contain a valid host name.public static java.net.URI resolve(java.net.URI originalURI,
HttpHost target,
java.util.List<java.net.URI> redirects)
throws java.net.URISyntaxException
URI.originalURI - original request before any redirectstarget - if the last URI is relative, it is resolved against this target,
or null if not available.redirects - collection of redirect locations since the original request
or null if not available.java.net.URISyntaxException@Deprecated
public static java.net.URI create(HttpHost host,
java.lang.String path)
throws java.net.URISyntaxException
URIBuilder.URI instances.java.net.URISyntaxException@Deprecated
public static java.net.URI create(java.lang.String scheme,
URIAuthority host,
java.lang.String path)
throws java.net.URISyntaxException
URIBuilder.URI instances.java.net.URISyntaxException