Here you can find the source of className(String path)
public static String className(String path)
//package com.java2s; //License from project: Apache License public class Main { public static String className(String path) { return path.replace('\\', '/').replace('/', '.').substring(0, path.length() - 6); }//from w ww . j a v a 2 s . co m /** * Replace given characters in a given string builder. * The number of characters to replace has to match to number of * characters serving as a replacement. * * @param sb string builder containing a string to be modified * @param from characters to replaced * @param to replacement characters * @return original string builder with replaced characters. */ public static StringBuilder replace(StringBuilder sb, CharSequence from, CharSequence to) { assert from.length() == to.length(); for (int i = 0; i < sb.length(); i++) for (int j = 0; j < from.length(); j++) if (sb.charAt(i) == from.charAt(j)) sb.setCharAt(i, to.charAt(j)); return sb; } }