Here you can find the source of getPathFromURL(final String url)
public static String getPathFromURL(final String url) throws MalformedURLException
//package com.java2s; //License from project: Open Source License import java.net.MalformedURLException; import java.net.URL; public class Main { public static String getPathFromURL(final String url) throws MalformedURLException { URL urlObj = new URL(url); return urlObj.getPath(); }/*from w ww . j a v a 2 s . com*/ }