class FileHelper {

    public static String getFileName(String path) {
        String fileName;
        int lastDot = path.lastIndexOf(".");
        int lastSeparator;
        if (lastDot > -1) {
            lastSeparator = path.substring(0,lastDot).lastIndexOf("/") + 1;
        } else {
            lastSeparator = path.lastIndexOf("/") + 1;
        }
        if (lastSeparator == 0) {
            lastSeparator = path.lastIndexOf("\\") + 1;
        }
        if (lastDot > -1 && lastSeparator < lastDot) {
            fileName = path.substring(lastSeparator, lastDot);
        } else {
            fileName = path.substring(lastSeparator);
        }
        return fileName;
    }

    private  FileHelper();

}