@Status(stage=DEVELOPMENT, unitTests=COMPLETE) @Review(by="Kees Schotanus", at="2012-09-27") @ThreadSafety(level=THREAD_SAFE) public final class QueryStringUtil extends Object
QueryString| Modifier and Type | Method and Description |
|---|---|
static String |
addQueryParameterToUrl(String url,
String name,
String value)
Adds a query parameter (name and value pair) to the supplied url.
|
static String |
decodeUrl(String url)
Decodes the supplied url using UTF-8 encoding as recommended by the W3C.
|
static String |
encodeUrl(String url)
Encodes the supplied url using UTF-8 encoding as recommended by the W3C.
|
static String |
getQueryString(String url)
Gets the raw, un-decoded, query string of the supplied url.
|
static Map<String,String> |
getQueryStringParameters(String queryString)
Gets all the parameters from the supplied query string.
|
public static String getQueryString(String url)
url - The url to get the query string from.NullPointerException - When the supplied url is null.public static Map<String,String> getQueryStringParameters(String queryString)
queryString - The query string to get the query parameters from.
NullPointerException - When the supplied queryString is null.public static String addQueryParameterToUrl(String url, String name, String value)
url - The url to which the supplied name and value will be added.name - Name of the query parameter to add.value - Value of the query parameter to add.
IllegalArgumentException - When either the supplied url or the supplied name is empty.NullPointerException - When either the supplied url or the supplied name is null.public static String encodeUrl(String url)
url - The url to encode.NullPointerException - When the supplied url is null.public static String decodeUrl(String url)
url - The url to decode.NullPointerException - When the supplied url is null.Copyright © 2008–2017. All rights reserved.