Here you can find the source of filename(String filename)
public static String filename(String filename)
//package com.java2s; //License from project: Open Source License public class Main { public static String filename(String filename) { int dot = filename.lastIndexOf("."); if (dot == -1) { return filename; }/*w w w . ja v a 2 s.c o m*/ return filename.substring(0, dot); } }