Here you can find the source of getUrlPath(URL url)
private static String getUrlPath(URL url) throws UnsupportedEncodingException
//package com.java2s; //License from project: LGPL import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URL; import java.net.URLDecoder; public class Main { private static String getUrlPath(URL url) throws UnsupportedEncodingException { return (new File(URLDecoder.decode(url.getPath(), "UTF-8")) .getAbsolutePath() + File.separator); }//from ww w .j a v a 2 s .com }