Here you can find the source of getName(URI uri)
public static String getName(URI uri)
//package com.java2s; import java.net.*; public class Main { public static String getName(URI uri) { String name = null;/*from w w w . j a v a 2s . co m*/ if (uri != null) { String path = uri.getPath(); if (path != null) { int index = path.lastIndexOf('/'); name = path.substring(index + 1); } } return name; } }