Class UrlDecoder

java.lang.Object
org.springframework.boot.loader.net.util.UrlDecoder

public final class UrlDecoder extends Object
Utility to decode URL strings. Copied from Spring Framework's StringUtils as we cannot depend on it in the loader.
Since:
3.2.0
Author:
Phillip Webb, Stephane Nicoll
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    decode(String source)
    Decode the given encoded URI component value by replacing each "%xy" sequence with a hexadecimal representation of the character in UTF-8, leaving other characters unmodified.
    static String
    decode(String source, Charset charset)
    Decode the given encoded URI component value by replacing each "%xy" sequence with a hexadecimal representation of the character in the specified character encoding, leaving other characters unmodified.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • decode

      public static String decode(String source)
      Decode the given encoded URI component value by replacing each "%xy" sequence with a hexadecimal representation of the character in UTF-8, leaving other characters unmodified.
      Parameters:
      source - the encoded URI component value
      Returns:
      the decoded value
    • decode

      public static String decode(String source, Charset charset)
      Decode the given encoded URI component value by replacing each "%xy" sequence with a hexadecimal representation of the character in the specified character encoding, leaving other characters unmodified.
      Parameters:
      source - the encoded URI component value
      charset - the character encoding to use to decode the "%xy" sequences
      Returns:
      the decoded value
      Since:
      4.0.0