Here you can find the source of fileNameToClassName(String f)
public static String fileNameToClassName(String f)
//package com.java2s; //License from project: Open Source License public class Main { public static String fileNameToClassName(String f) { f = removeFromEnd(f, ".class"); f = removeFromEnd(f, ".java"); return f.replace('\\', '.').replace('/', '.'); }/*from w ww . jav a2 s . c o m*/ private static String removeFromEnd(String s, String f) { return s.endsWith(f) ? s.substring(0, s.length() - f.length()) : s; } }