public String getQuery() { return url.encodedQuery(); }
/** * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, even if the request * URL is. Includes the query component if it exists. */ public static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return query != null ? (path + '?' + query) : path; } }
/** * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, even if the request * URL is. Includes the query component if it exists. */ public static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return query != null ? (path + '?' + query) : path; } }
public Builder newBuilder() { Builder result = new Builder(); result.scheme = scheme; result.encodedUsername = encodedUsername(); result.encodedPassword = encodedPassword(); result.host = host; // If we're set to a default port, unset it in case of a scheme change. result.port = port != defaultPort(scheme) ? port : -1; result.encodedPathSegments.clear(); result.encodedPathSegments.addAll(encodedPathSegments()); result.encodedQuery(encodedQuery()); result.encodedFragment = encodedFragment(); return result; }
public String getFile() { return url.querySize() == 0 ? url.encodedPath() : url.encodedPath() + '?' + url.encodedQuery(); }
this.encodedPathSegments.addAll(base.encodedPathSegments()); if (pos == limit || input.charAt(pos) == '#') { encodedQuery(base.encodedQuery());
public Builder newBuilder() { Builder result = new Builder(); result.scheme = scheme; result.encodedUsername = encodedUsername(); result.encodedPassword = encodedPassword(); result.host = host; // If we're set to a default port, unset it in case of a scheme change. result.port = port != defaultPort(scheme) ? port : -1; result.encodedPathSegments.clear(); result.encodedPathSegments.addAll(encodedPathSegments()); result.encodedQuery(encodedQuery()); result.encodedFragment = encodedFragment(); return result; }
this.encodedPathSegments.addAll(base.encodedPathSegments()); if (pos == limit || input.charAt(pos) == '#') { encodedQuery(base.encodedQuery());
@Test public void download_and_add_jar_to_cache_if_missing() throws Exception { FileAndMd5 tempJar = new FileAndMd5(); enqueueDownload(tempJar); InstalledPlugin plugin = newInstalledPlugin("foo", tempJar.md5); File result = underTest.get(plugin).get(); verifySameContent(result, tempJar); HttpUrl requestedUrl = server.takeRequest().getRequestUrl(); assertThat(requestedUrl.encodedPath()).isEqualTo("/api/plugins/download"); assertThat(requestedUrl.encodedQuery()).isEqualTo("plugin=foo&acceptCompressions=pack200"); // get from cache on second call result = underTest.get(plugin).get(); verifySameContent(result, tempJar); assertThat(server.getRequestCount()).isEqualTo(1); }
uriString = httpUrl.encodedPath(); } else { uriString = httpUrl.encodedPath() + '?' + httpUrl.encodedQuery();
/** * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, even if the request * URL is. Includes the query component if it exists. */ public static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return query != null ? (path + '?' + query) : path; } }
/** * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, * even if the request URL is. Includes the query component if it exists. */ public static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return query != null ? (path + '?' + query) : path; } }
/** * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, * even if the request URL is. Includes the query component if it exists. */ public static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return query != null ? (path + '?' + query) : path; } }
/** * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, even if the request * URL is. Includes the query component if it exists. */ public static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return query != null ? (path + '?' + query) : path; } }
/** * Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, even if the request * URL is. Includes the query component if it exists. */ public static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return query != null ? (path + '?' + query) : path; } }
private boolean matchesEncodedQuery(HttpUrl url, Description mismatchDescription) { if (!url.encodedQuery().contains(encodedQueryContains)) { mismatchDescription.appendText("encoded query was ").appendValue(url.encodedQuery()); return false; } return true; }
private String requestDecodedPath(HttpUrl url) { try { String path = URLDecoder.decode(url.encodedPath(), "UTF-8"); String query = URLDecoder.decode(url.encodedQuery(), "UTF-8"); return url.scheme() + "://" + url.host() + (query != null ? (path + '?' + query) : path); } catch (Exception ex) { /* Quality */ } return null; }
private String requestDecodedPath(HttpUrl url) { try { String path = URLDecoder.decode(url.encodedPath(), "UTF-8"); String query = URLDecoder.decode(url.encodedQuery(), "UTF-8"); return url.scheme() + "://" + url.host() + (query != null ? (path + '?' + query) : path); } catch (Exception ex) { /* Quality */ } return null; } }
private static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return url.scheme() + "://" + url.host() + (query != null ? (path + '?' + query) : path); } }
private static String requestPath(HttpUrl url) { String path = url.encodedPath(); String query = url.encodedQuery(); return url.scheme() + "://" + url.host() + (query != null ? (path + '?' + query) : path); }