|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.client.utils.URIUtils
@Immutable public class URIUtils
A collection of utilities for URIs
, to workaround
bugs within the class or for ease-of-use features.
Method Summary | |
---|---|
static URI |
createURI(String scheme,
String host,
int port,
String path,
String query,
String fragment)
Constructs a URI using all the parameters. |
static URI |
resolve(URI baseURI,
String reference)
Resolves a URI reference against a base URI. |
static URI |
resolve(URI baseURI,
URI reference)
Resolves a URI reference against a base URI. |
static URI |
rewriteURI(URI uri,
HttpHost target)
A convenience method for rewriteURI(URI, HttpHost, boolean) that always keeps the
fragment. |
static URI |
rewriteURI(URI uri,
HttpHost target,
boolean dropFragment)
A convenience method for creating a new URI whose scheme, host
and port are taken from the target host, but whose path, query and
fragment are taken from the existing URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static URI createURI(String scheme, String host, int port, String path, String query, String fragment) throws URISyntaxException
URI
using all the parameters. This should be
used instead of
URI.URI(String, String, String, int, String, String, String)
or any of the other URI multi-argument URI constructors.
scheme
- Scheme namehost
- Host nameport
- Port numberpath
- Pathquery
- Queryfragment
- Fragment
URISyntaxException
- If both a scheme and a path are given but the path is
relative, if the URI string constructed from the given
components violates RFC 2396, or if the authority
component of the string is present but cannot be parsed
as a server-based authoritypublic static URI rewriteURI(URI uri, HttpHost target, boolean dropFragment) throws URISyntaxException
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.
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.
URISyntaxException
- If the resulting URI is invalid.public static URI rewriteURI(URI uri, HttpHost target) throws URISyntaxException
rewriteURI(URI, HttpHost, boolean)
that always keeps the
fragment.
URISyntaxException
public static URI resolve(URI baseURI, String reference)
baseURI
- the base URIreference
- the URI reference
public static URI resolve(URI baseURI, URI reference)
baseURI
- the base URIreference
- the URI reference
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |