Here you can find the source of getFileNameWithoutExt(File file)
public static String getFileNameWithoutExt(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String getFileNameWithoutExt(File file) { if (file.getName().lastIndexOf(".") == -1) return file.getName(); return file.getName().substring(0, file.getName().lastIndexOf(".")); }/*from ww w . j a va 2 s . com*/ }