Here you can find the source of extractFileName(final String filePath)
public static String extractFileName(final String filePath)
//package com.java2s; /*/*w ww. j ava 2 s. co m*/ License: blueprint-sdk is licensed under the terms of Eclipse Public License(EPL) v1.0 (http://www.eclipse.org/legal/epl-v10.html) Distribution: Repository - https://github.com/lempel/blueprint-sdk.git Blog - http://lempel.egloos.com */ public class Main { private static final String fileSeparator = System.getProperty("file.separator"); public static String extractFileName(final String filePath) { String result; int pos = filePath.lastIndexOf(fileSeparator); if (pos < 0) { result = filePath; } else { result = filePath.substring(pos + 1, filePath.length()); } return result; } }