Package com.authlete.common.web
Class URLCoder
- java.lang.Object
-
- com.authlete.common.web.URLCoder
-
public class URLCoder extends Object
URL encoder/decoder.- Author:
- Takahiko Kawasaki
-
-
Constructor Summary
Constructors Constructor Description URLCoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
decode(String input)
URL-decode the input with UTF-8.static String
encode(String input)
URL-encode the input with UTF-8.static String
formUrlEncode(Map<String,?> parameters)
Convert the given map to a string inx-www-form-urlencoded
format.
-
-
-
Method Detail
-
encode
public static String encode(String input)
URL-encode the input with UTF-8.- Parameters:
input
- A string to be encoded.- Returns:
- Encoded string.
-
decode
public static String decode(String input)
URL-decode the input with UTF-8.- Parameters:
input
- An encoded string.- Returns:
- Decoded string.
-
formUrlEncode
public static String formUrlEncode(Map<String,?> parameters)
Convert the given map to a string inx-www-form-urlencoded
format.- Parameters:
parameters
- Pairs of key and values. The type of values must be eitherString[]
orList<String>
.- Returns:
- A string in
x-www-form-urlencoded
format.null
is returned ifparameters
isnull
. - Since:
- 1.24
-
-