Here you can find the source of extractFileName(String fullPath)
public static String extractFileName(String fullPath)
//package com.java2s; public class Main { public static String extractFileName(String fullPath) { String sep1 = "/"; String sep2 = "\\"; if (fullPath.lastIndexOf(sep1) >= 0) { return fullPath.substring(fullPath.lastIndexOf(sep1) + 1); } else if (fullPath.lastIndexOf(sep2) >= 0) { return fullPath.substring(fullPath.lastIndexOf(sep2) + 1); }//from w ww . j a v a 2 s . c o m return fullPath; } }