Here you can find the source of basename(String path)
static String basename(String path)
//package com.java2s; //License from project: Apache License public class Main { static final char PATH_SEP = '/'; static String basename(String path) { return path.substring(path.lastIndexOf(PATH_SEP) + 1); }/*from ww w . j av a 2 s .com*/ }