Here you can find the source of getPath(String uriStr)
public static String getPath(String uriStr)
//package com.java2s; import java.net.*; public class Main { public static String getPath(String uriStr) { URI uri = null;/*from w ww .ja va 2 s . c o m*/ try { uri = new URI(uriStr); } catch (URISyntaxException e) { throw new RuntimeException(e.getLocalizedMessage()); } return uri == null ? null : uri.getPath(); } }