Here you can find the source of getFileName(URI uri)
public static String getFileName(URI uri)
//package com.java2s; import java.net.URI; public class Main { public static String getFileName(URI uri) { String path[] = uri.toString().split("/"); return path[path.length - 1]; }/* ww w .j a v a2 s. co m*/ }