org.apache.struts2.util

## Class URLDecoderUtil

- java.lang.Object
- - org.apache.struts2.util.URLDecoderUtil

-     public class URLDecoderUtil
      extends Object

  URLDecoderUtil serves as a facade for a correct URL decoding implementation. As of Struts 2.3.25 it uses Tomcat URLDecoder functionality rather than the one found in java.io.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `URLDecoderUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `decode(String sequence, String charset)` Decodes a `x-www-form-urlencoded` string.
    `static String` | `decode(String sequence, String charset, boolean isQueryString)` Decodes a `x-www-form-urlencoded` string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### URLDecoderUtil

          public URLDecoderUtil()

  - ### Method Detail

    - #### decode

          public static String decode(String sequence,
                                      String charset)

      Decodes a `x-www-form-urlencoded` string.
      Parameters:
        `sequence` - the String to decode
        `charset` - The name of a supported character encoding.
      Returns:
        the newly decoded `String`
      Throws:
        `IllegalArgumentException` - If the encoding is not valid

    - #### decode

          public static String decode(String sequence,
                                      String charset,
                                      boolean isQueryString)

      Decodes a `x-www-form-urlencoded` string.
      Parameters:
        `sequence` - the String to decode
        `charset` - The name of a supported character encoding.
        `isQueryString` - whether input is a query string. If `true` other decoding rules apply.
      Returns:
        the newly decoded `String`
      Throws:
        `IllegalArgumentException` - If the encoding is not valid

Copyright © 2000–2022 Apache Software Foundation. All rights reserved.