Java Class Name Format classToFile(String name)

Here you can find the source of classToFile(String name)

Description

Converts a clas name to a file name.

License

Open Source License

Parameter

Parameter Description
name The class name

Declaration


public static String classToFile(String name) 

Method Source Code

//package com.java2s;
/*/*  w ww  . j a  v  a  2 s  .  c  om*/
 * Copyright (c) 1998 - 2005 Versant Corporation
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Versant Corporation - initial API and implementation
 */

public class Main {
    /**
     * Converts a clas name to a file name. All periods are replaced
     * with slashes and the '.class' extension is added.
     * @param name The class name
     */

    public static String classToFile(String name) {
        return name.replace('.', '/').concat(".class");
    }
}

Related

  1. classToAttributeName(Class clazz)
  2. classToFilename(Class clazz)
  3. classToFileName(String str)
  4. classToInstance(String uriClass)
  5. classToLDAPName(Class c)