Here you can find the source of pathToFullyQualifiedName(String classpath, String path)
public static String pathToFullyQualifiedName(String classpath, String path)
//package com.java2s; //License from project: Open Source License public class Main { public static String pathToFullyQualifiedName(String classpath, String path) { char[] buff = new char[path.length()]; String fqname = null;//from w w w. ja v a 2s . c o m for (int i = 0; i < buff.length; i++) { if (path.charAt(i) == '/' || path.charAt(i) == '\\') { buff[i] = '.'; } else { buff[i] = path.charAt(i); } } int classpathLength = 0; if (classpath != null) { classpathLength = classpath.length() + 1; } int classNameLength = path.length() - classpathLength - new String(".class").length(); fqname = new String(buff, classpathLength, classNameLength); return fqname; } }