Here you can find the source of extractFilename(String path)
public static String extractFilename(String path)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by public class Main { public static String extractFilename(String path) { if (path == null) return null; String norm = path.replace('\\', '/'); int i = norm.lastIndexOf('/'); if (i == -1) { return path; } else {//from w ww . j a va2s . co m return norm.substring(i + 1); } } }