Home | History | Annotate | Download | only in utils

Lines Matching refs:URI

32 import java.net.URI;
38 * A collection of utilities for {@link URI URIs}, to workaround
44 * Constructs a {@link URI} using all the parameters. This should be
46 * {@link URI#URI(String, String, String, int, String, String, String)}
47 * or any of the other URI multi-argument URI constructors.
68 * relative, if the URI string constructed from the given
73 public static URI createURI(
107 return new URI(buffer.toString());
111 * A convenience method for creating a new {@link URI} whose scheme, host
113 * fragment are taken from the existing URI. The fragment is only used if
116 * @param uri
124 * If the resulting URI is invalid.
126 public static URI rewriteURI(
127 final URI uri,
130 if (uri == null) {
131 throw new IllegalArgumentException("URI may nor be null");
138 uri.getRawPath(),
139 uri.getRawQuery(),
140 dropFragment ? null : uri.getRawFragment());
146 uri.getRawPath(),
147 uri.getRawQuery(),
148 dropFragment ? null : uri.getRawFragment());
154 * {@link URIUtils#rewriteURI(URI, HttpHost, boolean)} that always keeps the
157 public static URI rewriteURI(
158 final URI uri,
160 return rewriteURI(uri, target, false);
164 * Resolves a URI reference against a base URI. Work-around for bug in
165 * java.net.URI (<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4708535>)
167 * @param baseURI the base URI
168 * @param reference the URI reference
169 * @return the resulting URI
171 public static URI resolve(final URI baseURI, final String reference) {
172 return URIUtils.resolve(baseURI, URI.create(reference));
176 * Resolves a URI reference against a base URI. Work-around for bug in
177 * java.net.URI (<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4708535>)
179 * @param baseURI the base URI
180 * @param reference the URI reference
181 * @return the resulting URI
183 public static URI resolve(final URI baseURI, URI reference){
185 throw new IllegalArgumentException("Base URI may nor be null");
188 throw new IllegalArgumentException("Reference URI may nor be null");
192 reference = URI.create("#");
194 URI resolved = baseURI.resolve(reference);
197 resolved = URI.create(resolvedString.substring(0,