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

StringdecodeInternally(String encoded)
decode Internally
try {
    return URLDecoder.decode(encoded, "UTF8");
} catch (UnsupportedEncodingException e) {
    throw new UncheckedIOException(e);
StringdecodeJobHistoryFileName(String logFileName)
Helper function to decode the URL of the filename of the job-history log file.
String decodedFileName = null;
try {
    decodedFileName = URLDecoder.decode(logFileName, "UTF-8");
} catch (UnsupportedEncodingException uee) {
    IOException ioe = new IOException();
    ioe.initCause(uee);
    ioe.setStackTrace(uee.getStackTrace());
    throw ioe;
...
MapdecodeKVMap(String keyValueString)
Unwrap a URI-encoded key value map into its constituents.
Map<String, String> keyValueMap = new HashMap<String, String>();
if (keyValueString != null && !keyValueString.isEmpty()) {
    if (keyValueString.startsWith("?")) {
        keyValueString = keyValueString.substring(1);
    String[] keyValuePairs = keyValueString.split("&");
    for (String keyValuePair : keyValuePairs) {
        try {
...
StringdecodeName(final String name)
decode Name
try {
    return URLDecoder.decode(name, "UTF-8");
} catch (UnsupportedEncodingException e) {
    throw new IllegalStateException(
            "Unsupported UTF-8 charset. Scenarioo needs to run on a JVM or server environment that supports 'UTF-8'.",
            e);
StringdecodeName(String createdName)
decode Name
try {
    return URLDecoder.decode(createdName, "UTF-8");
} catch (final UnsupportedEncodingException e) {
    e.printStackTrace();
return createdName;
StringDecodePath(String path)
Decode Path
if (path.startsWith("/")) {
    path = path.substring(1);
String[] pathElements = path.split("/");
StringBuffer sb = new StringBuffer();
for (String string : pathElements) {
    sb.append("/").append(URLDecoder.decode(string, "UTF-8"));
return sb.toString();
StringdecodePercent(String s)
decode Percent
try {
    return URLDecoder.decode(s, ENCODING);
} catch (java.io.UnsupportedEncodingException wow) {
    throw new RuntimeException(wow.getMessage(), wow);
StringdecodePercent(String str)
Decode percent encoded String values.
String decoded = null;
try {
    decoded = URLDecoder.decode(str, "UTF8");
} catch (UnsupportedEncodingException ignored) {
return decoded;
StringdecodeRequestBody(String requestBody)
Decode given request body as UTF-8 string.
return URLDecoder.decode(requestBody, "UTF-8");
StringdecodeRequestString2(String inputString)
decode Request String
if (inputString.startsWith("REQUEST=")) {
    inputString = inputString.substring(8);
} else if (inputString.startsWith("---")) {
    int iIndexStart = inputString.indexOf("<?xml");
    inputString = inputString.substring(iIndexStart);
    int iIndexEnd = inputString.indexOf("---");
    inputString = inputString.substring(0, iIndexEnd);
return java.net.URLDecoder.decode(inputString, "ISO-8859-1");