Here you can find the source of getFilename(String path)
public static String getFilename(String path)
//package com.java2s; import java.io.File; public class Main { public static String getFilename(String path) { int pos = path.lastIndexOf(File.separator); return path.substring(pos + 1, path.length()); }// w w w. j a va 2 s .c o m }