Here you can find the source of cleanUrl(String url)
public static String cleanUrl(String url)
//package com.java2s; //License from project: Apache License public class Main { public static String cleanUrl(String url) { String cleanUrl = url.trim(); if (cleanUrl.length() >= 8) { if (cleanUrl.substring(0, 7).equalsIgnoreCase("http://")) { cleanUrl = "http://" + cleanUrl.substring(7); } else if (cleanUrl.substring(0, 8).equalsIgnoreCase("https://")) { cleanUrl = "https://" + cleanUrl.substring(8); }//from ww w. ja v a 2 s .co m } return cleanUrl; } }