Here you can find the source of getFileNameFromURL(URL url)
public static String getFileNameFromURL(URL url)
//package com.java2s; import java.net.URL; public class Main { public static String getFileNameFromURL(URL url) { String fileName = url.getFile(); return fileName.substring(fileName.lastIndexOf('/') + 1); }//w w w. j a v a 2 s .c o m }