Here you can find the source of getRootName(String fnm)
public static String getRootName(String fnm)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String getRootName(File f) { String fnm = f.getName(); return getRootName(fnm); }//ww w . java 2 s.c o m public static String getRootName(String fnm) { int ild = fnm.lastIndexOf("."); String root = fnm; if (ild > 0) { root = fnm.substring(0, fnm.lastIndexOf(".")); } return root; } }