Java Path Convert To pathToClassName(String pathName)

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

Description

path To Class Name

License

Apache License

Declaration

private static String pathToClassName(String pathName) 

Method Source Code

//package com.java2s;
/*/* w w  w .ja va 2  s . c o m*/
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

public class Main {
    private static String pathToClassName(String pathName) {
        return pathName.replace('/', '.').replace('\\', '.'); // replace unix and windows separators
    }
}

Related

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