Here you can find the source of pathToQualifiedName(final String path)
Parameter | Description |
---|---|
path | The relative path to the .class file |
public static String pathToQualifiedName(final String path)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j a v a2s. c o m*/ * Formats a file path to a class into a fully qualified class name. * * @param path * The relative path to the .class file * @return The qualified class name. */ public static String pathToQualifiedName(final String path) { String delim = System.getProperty("file.separator"); // if using a windows style separator add the escape character if (delim.equals("\\")) { delim += "\\"; } String name = path.substring(0, path.lastIndexOf('.')); name = name.replaceAll(delim, "."); return name; } }