public final class URLUtils
extends Object
Class to deal with URLs
| Constructor | Description |
|---|---|
URLUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static String |
appendParamsToUrl(String url,
String params) |
Convenience call to add parameters to a url.
|
static String |
decodeValue(String val) |
Wrapper for URLDecoder.decode(val, "UTF-8");
|
static String |
encodeValue(String val) |
Wrapper for URLEncoder.encode(val, "UTF-8");
|
static String |
getParamValue(java.util.Map params,
String key) |
Helper funtion to get single value from multiple value parameter Map
|
static java.util.Map |
parseQueryStr(String queryString,
boolean doDecode) |
Parse query string part of url into Map of Lists (to support multiple values) of query parameters
|
static String |
pathToFileURL(String basePath) |
Convert a path to a url (file://[path])
|
static String |
urlToId(java.net.URL url) |
Create a MD5 message digest hash of a url
|
public static String appendParamsToUrl(String url,
String params)
url - input urlparams - parameters in the form param1=val1¶m2=val2public static String decodeValue(String val)
val - value to decodepublic static String encodeValue(String val)
val - value to encodepublic static String getParamValue(java.util.Map params,
String key)
params - params Mapkey - key stringpublic static java.util.Map parseQueryStr(String queryString,
boolean doDecode)
queryString - query stringdoDecode - true to use URLDecoder.decode() to decode parameterspublic static String pathToFileURL(String basePath)
basePath - pathpublic static String urlToId(java.net.URL url)
url - url to hash