Here you can find the source of normalizeUrlStr(String urlStr)
public static String normalizeUrlStr(String urlStr)
//package com.java2s; //License from project: Open Source License public class Main { public static String normalizeUrlStr(String urlStr) { if (urlStr == null) return (null); if (!urlStr.startsWith("http://")) urlStr = "http://" + urlStr; // TODO: handle lack of "www."? //if (urlStr.startsWith("http://")) { // if (urlStr.substring()) //}//from w ww .j av a2 s .c om if (urlStr.endsWith("/")) return (urlStr.substring(0, urlStr.length() - 1)); return (urlStr); } }