Here you can find the source of urlEncode(String str)
static String urlEncode(String str)
//package com.java2s; //License from project: Open Source License public class Main { static String urlEncode(String str) { str = str.replace('+', '-').replace('/', '_'); return str.replace("=", ""); }/*from ww w. ja v a 2s. c o m*/ }