Creates a new URL string from the specified base URL and parameters
encoded in non-form encoding, www-urlencoded.

@param baseUrl The base URL excluding parameters.
@param paramMap The parameters.
@return The full URL string.
557765
public static String newWwwUrlEncodedUrl(final String baseUrl,
        final Map<String, String> paramMap)
        {
        final StringBuilder sb = new StringBuilder();
        sb.append(baseUrl);
        sb.append(getUrlParameters(paramMap, false));
        return sb.toString();
        }
664319
public static String paramMapToString(final Map<String, String[]> parameters) {

        final StringBuffer result = new StringBuffer();
        for (final String key : parameters.keySet()) {
            String[] values = parameters.get(key);
            if (null == values) {
                result.append(key).append('&');
            } else {
                for (final String value : parameters.get(key)) {
                    result.append(key).append('=').append(CmsEncoder.encode(value)).append('&');
                }
            }
        }
        // remove last '&'
        if (result.length() > 0) {
            result.setLength(result.length() - 1);
        }
        return result.toString();
    }
788056
public static URL getUrl(String url) {
    try {
      return new URL(url);
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
1313202
function removeParameters(url) {
	var baseURL = url;

	// Iterate over all parameters
	for (var int = 0; int < params.length; int++) {

		// Remove parameter
		baseURL = baseURL.replace(new RegExp(params[int] + '=[^&]*&', 'ig'), '');
	}

	return baseURL;
}
1187016
private Map<String, String[]> getParameterMap(String url) {

        Map<String, String[]> result = new HashMap<String, String[]>();
        if (CmsStringUtil.isNotEmpty(url)) {
            int pos = url.indexOf(CmsRequestUtil.URL_DELIMITER);
            if (pos >= 0) {
                result = CmsRequestUtil.createParameterMap(url.substring(pos + 1));
            }
        }
        return result;
    }
1194933
public static Map<URLParts, String> splitURL(String URLString) {
        try {
            return splitURL(new URL(URLString));
        } 
        catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
        }
    }
609024
@SuppressWarnings("checkstyle:abbreviationaswordinname")
    public URL constructURL() {
        String params = encodeQueryParams();
        String stringUri = url;

        if (params.length() > 0) {
            stringUri += "?" + params;
        }

        try {
            URI uri = new URI(stringUri);
            return uri.toURL();
        } catch (final URISyntaxException e) {
            throw new ApiException("Bad URI: " + stringUri, e);
        } catch (final MalformedURLException e) {
            throw new ApiException("Bad URL: " + stringUri, e);
        }
    }
229539
public String encodeURL(String arg0)
    {
        return reqContext.encodeURL(_webApp, (HttpServletRequest) _request, arg0);
    }
1223184
private static String buildUrl(String host, String path, String param) {
        try {
            StringBuilder sbUrl = new StringBuilder();
            sbUrl.append(host);
            if (StringUtil.isNotEmpty(path)) {
                sbUrl.append(path);
            }
            if (StringUtil.isNotEmpty(param)) {
                StringBuilder sbParam = new StringBuilder();
                sbParam.append(URLEncoder.encode(param, Charset.UTF_8));
                if (0 < sbParam.length()) {
                    sbUrl.append("?").append(sbParam);
                }
            }

            return sbUrl.toString();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }
671443
public ArmeriaRetrofitBuilder baseUrl(String baseUrl) {
        requireNonNull(baseUrl, "baseUrl");
        final URI uri = URI.create(baseUrl);
        checkArgument(SessionProtocol.find(uri.getScheme()).isPresent(),
                      "baseUrl must have an HTTP scheme: %s", baseUrl);
        final String path = uri.getPath();
        if (!path.isEmpty() && !SLASH.equals(path.substring(path.length() - 1))) {
            throw new IllegalArgumentException("baseUrl must end with /: " + baseUrl);
        }
        this.baseUrl = baseUrl;
        return this;
    }
697174
protected function _constructBaseUrl($servlet, $params = array())
    {
        if (count($params))
        {
            //escape all parameters appropriately for inclusion in the query string
            $escapedParams = array();

            foreach ($params as $key => $value)
            {
                $escapedParams[] = urlencode($key) . '=' . urlencode($value);
            }

            $queryString = $this->_queryDelimiter . implode($this->_queryStringDelimiter, $escapedParams);
        }
        else
        {
            $queryString = '';
        }
        
        if (!$this->_basePath) {
            throw new Exception('Please provide a base path');
        }

        $protocol = 'http://';
        if ($this->_useHttps) {
            $protocol = 'https://';
        }
        return $protocol . $this->_host . ':' . $this->_port . $this->_basePath . $servlet . $queryString;
    }
1250349
public static Map<String, String> transformMap(final Map<String, Object> paramMap) {
        final Map<String, String> paramStrMap = new LinkedHashMap<String, String>();
        for (final Map.Entry<String, Object> entry : paramMap.entrySet()) {
            paramStrMap.put(entry.getKey(), entry.getValue().toString());
        }

        return paramStrMap;
    }
1346031
protected String getBaseUrl(String url) {
    	if (url.endsWith("/")) {
    	    return url.substring(0, url.length() - 1);
    	}
    	else {
    	    return url;
    	}
    	
    }
839633
public static String encodeUrl(String stringToEncode) {
        try {
            return URLEncoder.encode(stringToEncode, "UTF-8");
        } catch (UnsupportedEncodingException e1) {
            throw new RuntimeException(e1);
        }
    }
1155034
public static String getURLString(String methodName,
			Map<String, Object> params) throws MusixMatchException {
		String paramString = new String();

		paramString += methodName + "?";

		for (Map.Entry<String, Object> entry : params.entrySet()) {
			try {
				paramString += entry.getKey()
						+ "="
						+ URLEncoder.encode(entry.getValue().toString(),
								"UTF-8");
			} catch (UnsupportedEncodingException e) {
				throw new MusixMatchException("Problem encoding "
						+ entry.getValue(), e);
			}

			paramString += "&";
		}

		paramString = paramString.substring(0, paramString.length() - 1);

		return paramString;
	}
251199
public static String getBaseURL(String url) {
		URL u = toURL(url);
		String base = null;
		if (u != null) {
			try {
				base = u.toURI().getScheme().concat("://").concat(u.getAuthority());
			} catch (URISyntaxException ex) {
				base = null;
			}
		}
		return base;
	}
1285585
protected HttpGet generateGetRequest(final String path, final Map<String, Object> paramMap) {
        final List<NameValuePair> pairs = new ArrayList<NameValuePair>();
        for (final String key : paramMap.keySet()) {
            pairs.add(new BasicNameValuePair(key, paramMap.get(key).toString()));
        }
        final URI uri = buildUri(path, pairs);
        return new HttpGet(uri);
    }