Here you can find the source of getPath(final URI uri)
public static String getPath(final URI uri)
//package com.java2s; //License from project: Apache License import java.net.URI; public class Main { public static String getPath(final URI uri) { return isFileUri(uri) ? uri.getPath() : uri.toASCIIString(); }// w w w . jav a 2s .co m public static boolean isFileUri(final URI uri) { return "file".equals(uri.getScheme()); } }