Java Path Convert To pathToClassName(String path)

Here you can find the source of pathToClassName(String path)

Description

Converts a path to class name, i.e., replaces "/" by "."

License

Open Source License

Parameter

Parameter Description
path the path to convert

Return

the class name

Declaration

public static String pathToClassName(String path) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from   w  w  w .  j a  v  a  2  s  .c o m
     * Converts a path to class name, i.e., replaces "/" by "." and removes the
     * ".class" extension.
     *
     * @param path the path to convert
     * @return the class name
     */
    public static String pathToClassName(String path) {
        return path.substring(0, path.length() - 6).replace("/", ".");
    }
}

Related

  1. filePathToPackagePathOrNull(String path)
  2. filePathToUrl(String filePath)
  3. pathTo(String filename)
  4. pathTo(String ref)
  5. pathToAdjacencyList(final int[] path, final int[] adjacencyList)
  6. pathToClassName(String pathName)
  7. pathToEmbedded(String relationType)
  8. pathToFields(String beanPath)
  9. pathToFile(String f)