Here you can find the source of getFileName(File f)
public static String getFileName(File f)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static String getFileName(File f) { int pos = f.getName().lastIndexOf("."); String fileName = f.getName().substring(0, pos); return fileName; }/* ww w.j a va 2 s . c o m*/ }