Here you can find the source of getFilename(String path)
public static String getFilename(String path)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.List; import com.google.common.base.Splitter; public class Main { public static String getFilename(String path) { List<String> list = Splitter.on(File.separator).splitToList(path); return list.get(list.size() - 1); }/*from w ww . j ava 2 s .c o m*/ }