Java Utililty Methods URL Decode

List of utility methods to do URL Decode

Description

The list of methods to do URL Decode are organized into topic(s).

Method

Stringdecode(String input)
* Returns a URL decoded String obtained from input, which is assumed to be a URL encoded String composed of characters in the default charset.
String decoded = input;
try {
    decoded = URLDecoder.decode(input, getCharset());
} catch (Exception ex) {
    ex.printStackTrace();
return decoded;
Stringdecode(String path)
decode
try {
    return path == null ? null : URLDecoder.decode(path, "UTF-8"); 
} catch (UnsupportedEncodingException e) {
    return path;
Stringdecode(String path, String encoding)
Decode the path.
try {
    return URLDecoder.decode(path, encoding);
} catch (UnsupportedEncodingException e) {
    throw new IllegalArgumentException("Cannot decode: " + path + " [" + encoding + "]", e);
Stringdecode(String raw)

Decode the message by replacing all the %20 with white spaces.

String encoded = null;
try {
    encoded = URLDecoder.decode(raw.replaceAll("%20", " "), "UTF-8");
} catch (UnsupportedEncodingException e) {
    e.printStackTrace();
return encoded;
Stringdecode(String s)
URL decoding.
try {
    if (s != null)
        return URLDecoder.decode(s, "UTF-8");
    else
        return s;
} catch (UnsupportedEncodingException e) {
    return s;
Stringdecode(String s)
decode
if (s == null) {
    return "";
try {
    try {
        return (URLDecoder.decode(s, "UTF-8"));
    } catch (IllegalArgumentException e) {
        int pos = s.lastIndexOf("%");
...
Stringdecode(String s)
decode
String ret = s;
try {
    ret = URLDecoder.decode(s.trim(), "UTF-8");
} catch (Exception e) {
return ret;
Stringdecode(String s)
decode
String ret = s;
try {
    ret = URLDecoder.decode(s.trim(), "UTF-8");
} catch (Exception localException) {
return ret;
Stringdecode(String s)
URL decodes the specified string using the UTF-8 character encoding.
try {
    return (s != null) ? URLDecoder.decode(s, "UTF-8") : null;
} catch (UnsupportedEncodingException uee) {
    throw new RuntimeException("UTF-8 is unknown in this Java.");
Stringdecode(String s, boolean formDecode)
decode
if (s == null)
    return null;
if (formDecode)
    return formDecode(s);
return urlDecode(s);