Java tutorial
//package com.java2s; import java.net.MalformedURLException; import java.net.URL; public class Main { public static String getPathFromUrl(String url) { URL iurl; try { iurl = new URL(url); return iurl.getPath(); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); return ""; } } }