Here you can find the source of getFilenameWithoutExtention(File file)
public static String getFilenameWithoutExtention(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String getFilenameWithoutExtention(File file) { return stripExtension(file.getName()); }/* w w w.j ava 2s . co m*/ public static String stripExtension(String str) { if (str == null) return null; int pos = str.lastIndexOf("."); if (pos == -1) return str; return str.substring(0, pos); } }