Here you can find the source of extractFileName(String fileName)
public static String extractFileName(String fileName)
//package com.java2s; //License from project: Open Source License public class Main { public static String extractFileName(String fileName) { if (null == fileName || "".equals(fileName.trim())) { throw new IllegalArgumentException("File Name cannot be Null/Empty"); }/*from w w w . java 2s . c o m*/ int extensionStartPt = fileName.lastIndexOf("."); return fileName.substring(0, extensionStartPt); } }