Here you can find the source of encodeURL(String value)
public static String encodeURL(String value) throws UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { public static String encodeURL(String value) throws UnsupportedEncodingException { if (!isEmpty(value)) { return URLEncoder.encode(value, "UTF-8"); }/*from w w w.j a v a 2 s . com*/ return ""; } public static boolean isEmpty(String value) { return value == null || value.trim().equals("") || value.length() == 0; } }