Here you can find the source of getPath(URI uri)
public static String getPath(URI uri)
//package com.java2s; //License from project: Apache License import java.net.URI; public class Main { public static String getPath(URI uri) { String path = uri.getPath(); if (path == null) { path = uri.getSchemeSpecificPart(); }/*from w ww .jav a 2 s . c o m*/ return path; } }