List of utility methods to do URL Create
String | buildUrl(final String baseUrl, final Map build Url if (parts == null || parts.length < 1) { return baseUrl; final StringBuilder urlBuilder = new StringBuilder(); if (!parts[0].startsWith(baseUrl)) { urlBuilder.append(baseUrl); for (String part : parts) { ... |
String | buildUrl(final String baseUrl, final String basePath, final String[] parts) build Url return buildUrl(baseUrl, basePath, null, parts);
|
String | buildUrl(final String baseUrl, final String... parts) Given a base URL and some path fragments, build a complete, valid URL if (parts == null || parts.length < 1) { return baseUrl; final StringBuilder urlBuilder = new StringBuilder(); if (parts[0] == null || !parts[0].startsWith(baseUrl)) { urlBuilder.append(baseUrl); for (String part : parts) { ... |
URL | buildUrl(final String domain, final String path) Builds an URL given a domain and a path. try { return new URL(new URL(domain), path); } catch (MalformedURLException e) { throw new RuntimeException(e); |
URL | buildUrl(String base, Map params) build Url StringBuffer sb = new StringBuffer(base); sb.append("?"); Iterator ip = params.keySet().iterator(); while (ip.hasNext()) { String param = (String) ip.next(); if (param == null) continue; sb.append(param); ... |
String | buildUrl(String baseUrl, Map queryParams, String anchor) Builds an URL. StringBuffer url = new StringBuffer(); url.append(baseUrl); if (queryParams != null && !queryParams.isEmpty()) { url.append(QUERY_CHAR); url.append(makeUriString(queryParams)); if (anchor != null) { url.append(ANCHOR_CHAR); ... |
URL | buildUrl(String context, String... relocations) Use URL context and one or more relocations to build end URL. try { return buildUrl(new URL(context), relocations); } catch (MalformedURLException e) { throw new AssertionError("URL('" + context + "') isn't valid URL"); |
String | buildUrl(String context, String... relocations) Use URL context and one or more relocations to build end URL. URL url = new URL(context); for (String move : relocations) { url = new URL(url, move); return url.toString(); |
URL | buildUrl(String host, int port, String path, Map Build a request URL. return buildUrl("http", port, path, parameters); |
URL | buildUrl(String host, int port, String path, Map Build a request URL. StringBuffer buffer = new StringBuffer(); if (!host.startsWith("http://")) { buffer.append("http://"); buffer.append(host); if (port > 0) { buffer.append(':'); buffer.append(port); ... |