Java Class Name Format classToFileName(String str)

Here you can find the source of classToFileName(String str)

Description

A method that gets a class based on its file name.

License

Open Source License

Parameter

Parameter Description
str The string.

Return

The modified string.

Declaration

public static String classToFileName(String str) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*w  ww  . j av  a 2 s  . c  o m*/
     * A method that gets a class based on its file name.
     * @param str The string.
     * @return The modified string.
     */
    public static String classToFileName(String str) {
        str = str.replace('.', '/');
        if (!str.endsWith(".class")) {
            str = str + ".class";
        }
        return str;
    }
}

Related

  1. classToAttributeName(Class clazz)
  2. classToFile(String name)
  3. classToFilename(Class clazz)
  4. classToInstance(String uriClass)
  5. classToLDAPName(Class c)
  6. classToPath(Class clazz)
  7. classToPath(String name, boolean resource)