Java Path Convert To pathToName(String path, String fileName)

Here you can find the source of pathToName(String path, String fileName)

Description

Replaces forward slashes in path with periods and returns a file name based on the path information

License

Open Source License

Parameter

Parameter Description
path a parameter
fileName a parameter

Declaration

public static String pathToName(String path, String fileName) 

Method Source Code

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

public class Main {
    /**//  w  w  w . j av a2 s  .  c  o m
     * Replaces forward slashes in path with periods and returns a file 
     * name based on the path information
     * @param path
     * @param fileName
     * @return
     */
    public static String pathToName(String path, String fileName) {
        return path.split("m/s/")[1].replace("/", ".") + fileName;
    }
}

Related

  1. pathToEmbedded(String relationType)
  2. pathToFields(String beanPath)
  3. pathToFile(String f)
  4. pathToFullyQualifiedName(String classpath, String path)
  5. pathToName(String path)
  6. pathTooLong()
  7. pathToPackageName(String relativeFileName, boolean leadingDot)
  8. pathToQualifiedClassName(final String path)
  9. pathToQualifiedName(final String path)