|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.http.UrlHelper
public class UrlHelper
Static helpers for manipulating URLs and URIs.
Field Summary | |
---|---|
static String |
UTF_8
The name of the UTF-8 encoding for Charset.forName(String) . |
Constructor Summary | |
---|---|
UrlHelper()
|
Method Summary | |
---|---|
static String |
appendQueryParameter(String q,
String key,
String value)
Append additional query parameters to the end of a given query string. |
static String |
appendQueryParameterToUrl(String url,
String key,
String value)
Append additional query parameters to the end of a given URL. |
static String |
decodeUtf8(String s)
Decodes a application/x-www-form-urlencoded string using
UTF-8 encoding as stated in the
World Wide Web Consortium Recommendation. |
static String |
encodeUtf8(String s)
Translates a string into application/x-www-form-urlencoded
format using UTF-8 encoding as stated in the
World Wide Web Consortium Recommendation. |
static Map<String,List<String>> |
parseQuery(String q)
Parse a given query string in application/x-www-form-urlencoded
format using UTF-8 encoding. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UTF_8
Charset.forName(String)
.
Constructor Detail |
---|
public UrlHelper()
Method Detail |
---|
public static final String encodeUtf8(String s)
application/x-www-form-urlencoded
format using UTF-8 encoding as stated in the
World Wide Web Consortium Recommendation.
URLEncoder.encode(s,"UTF-8")
this function
does not throw any checked exception.
s
- String
to be translated.
String
.URLEncoder.encode(java.lang.String, java.lang.String)
public static final String decodeUtf8(String s)
application/x-www-form-urlencoded
string using
UTF-8 encoding as stated in the
World Wide Web Consortium Recommendation.
URLDecoder.decode(s,"UTF-8")
this function
does not throw any checked exception.
s
- the String
to decode.
String
URLDecoder.decode(String, String)
public static final String appendQueryParameterToUrl(String url, String key, String value)
url
- The base URL, which my already contain other query parameters.key
- The name of the parameter.value
- The value, which will be appended using encodeUtf8(String)
.
public static final String appendQueryParameter(String q, String key, String value)
q
- The query part of an URL or URI as returned by URL.getQuery()
or URI.getQuery()
.key
- The name of the parameter.value
- The value, which will be appended using encodeUtf8(String)
.
public static final Map<String,List<String>> parseQuery(String q)
application/x-www-form-urlencoded
format using UTF-8 encoding.
q
- The query part of an URL or URI as returned by URL.getQuery()
or URI.getQuery()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |