Here you can find the source of getFileName2(String url)
public static String getFileName2(String url)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.net.URI; public class Main { public static String getFileName2(String url) { String file = null;/*from www.ja va2 s .c o m*/ try { file = (new File((new URI(url)).getPath())).getName(); System.out.println("File name: " + file); } catch (Exception var3) { ; } if (file == null || file.length() < 1) { file = "FILE"; } return file; } }