Here you can find the source of encodeUrlParam(String s)
public static String encodeUrlParam(String s)
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { public static String encodeUrlParam(String s) { try {/*w w w . ja va 2 s .c om*/ return URLEncoder.encode(s.replace("/", "%2F"), "UTF-8") .replace("+", "%20"); } catch (UnsupportedEncodingException e) { return s; } } }