A collection of utilities for java.net.URI, to workaround bugs within the class or for ease-of-use features.
More...
Notice
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
|
static URI | createURI (final String scheme, final String host, int port, final String path, final String query, final String fragment) throws URISyntaxException |
| Constructs a java.net.URI using all the parameters. More...
|
|
static URI | rewriteURI (final URI uri, final HttpHost target, boolean dropFragment) throws URISyntaxException |
| A convenience method for creating a new java.net.URI whose scheme, host and port are taken from the target host, but whose path, query and fragment are taken from the existing URI. More...
|
|
static URI | rewriteURI (final URI uri, final HttpHost target) throws URISyntaxException |
| A convenience method for rewriteURI that always keeps the fragment.
|
|
static URI | resolve (final URI baseURI, final String reference) |
| Resolves a URI reference against a base URI. More...
|
|
static URI | resolve (final URI baseURI, URI reference) |
| Resolves a URI reference against a base URI. More...
|
|
static URI createURI |
( |
final String |
scheme, |
|
|
final String |
host, |
|
|
int |
port, |
|
|
final String |
path, |
|
|
final String |
query, |
|
|
final String |
fragment |
|
) |
| throws URISyntaxException |
|
static |
This should be used instead of java.net.URI(String, String, String, int, String, String, String) or any of the other URI multi-argument URI constructors.
See HTTPCLIENT-730 for more information.
- Parameters
-
scheme | Scheme name |
host | Host name |
port | Port number |
path | Path |
query | Query |
fragment | Fragment |
- Exceptions
-
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 RFC2396, or if the authority component of the string is present but cannot be parsed as a server-based authority |