Java tutorial
//package com.java2s; public class Main { public static String resolveFileNameForPath(String filePath) { int index = 0; String fileName = ""; if ((index = filePath.lastIndexOf("/")) != -1) fileName = filePath.substring(index + 1); return fileName.contains(".") ? fileName : ""; } }