Here you can find the source of getNoQueryUrl(String source)
public static String getNoQueryUrl(String source)
//package com.java2s; import java.net.MalformedURLException; import java.net.URL; public class Main { public static String getNoQueryUrl(String source) { String dest = null;/*w ww. ja v a 2s. c o m*/ try { URL sUrl = new URL(source); URL dUrl = new URL(sUrl.getProtocol(), sUrl.getHost(), sUrl.getPort(), sUrl.getPath()); dest = dUrl.toString(); } catch (MalformedURLException e) { e.printStackTrace(); } return dest; } }