程序包 com.ajaxjs.util

类 UrlEncode

java.lang.Object
com.ajaxjs.util.UrlEncode

public class UrlEncode extends Object
  • 构造器详细资料

    • UrlEncode

      public UrlEncode(String input)
      Create a new UrlEncode with input string. It's a default constructor.
      参数:
      input - The string input
    • UrlEncode

      public UrlEncode(String input, Charset charset)
      Create a new UrlEncode with input string and specified charset
      参数:
      input - The string input
      charset - The charset of the input string
  • 方法详细资料

    • encode

      public String encode()
      Do the url encode with specified charset
      返回:
      The string being URL encoded
    • encodeQuery

      public String encodeQuery()
      Do the url encode, best for GET request

      ...

      返回:
      The string being URL encoded
    • encodeSafe

      public String encodeSafe()
      Do the url encode TODO ToFixMe: fails in UnitTest
      返回:
      The string being URL encoded
    • decode

      public String decode()
      Do the url decode
      返回:
      The string being URL decode
    • urlChinese

      public static String urlChinese(String str)
      URL 网址的中文乱码处理。 如果 Tomcat 过滤器设置了 UTF-8 那么这里就不用重复转码了
      参数:
      str - 通常是 URL 的 Query String 参数
      返回:
      中文
    • parseStringToMap

      public static Map<String,String> parseStringToMap(String accessTokenStr)
      字符串转 Map,格式为 xxx=xxx&xxx=xxx
      参数:
      accessTokenStr - 待转换的字符串
      返回:
      map