Class URLCoder


  • public class URLCoder
    extends Object
    URL encoder/decoder.
    Author:
    Takahiko Kawasaki
    • Constructor Detail

      • URLCoder

        public URLCoder()
    • 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 in x-www-form-urlencoded format.
        Parameters:
        parameters - Pairs of key and values. The type of values must be either String[] or List<String>.
        Returns:
        A string in x-www-form-urlencoded format. null is returned if parameters is null.
        Since:
        1.24