List of utility methods to do File Name to Class Name
String | fileNameToClass(String fileName) file Name To Class return fileName.substring(0, fileName.length() - ".class".length()).replace('/', '.'); |
String | fileNameToClassName(String f) file Name To Class Name f = removeFromEnd(f, ".class"); f = removeFromEnd(f, ".java"); return f.replace('\\', '.').replace('/', '.'); |
String | filenameToClassname(String filename) filename To Classname if (filename == null) throw new IllegalArgumentException("File name is null"); filename = filename.replace('/', '.'); filename = filename.replace('\\', '.'); if (filename.startsWith(".")) filename = filename.substring(1, filename.length()); filename = filename.substring(0, filename.length() - 6); return filename; ... |
String | filenameToClassname(String fileName) This method checks and transforms the filename of a potential Class given by fileName .
if (fileName.toLowerCase().endsWith(".class")) return fixClassName(fileName.substring(0, fileName.length() - 6)); return null; |