Java Path File Name nio GetPathName(String path)

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

Description

Get Path Name

License

Apache License

Declaration

public static String GetPathName(String path) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {
    public static String GetPathName(String path) {
        return Path2UnixStr(Paths.get(path).getFileName());
    }/* w w w . jav  a 2 s.c  o  m*/

    public static String Path2UnixStr(Path path) {
        return path.toString().replace("\\", "/");
    }
}

Related

  1. getPathByClassName(Class clazz, String relativeDir)
  2. getPathByFilename(String filename, List files)
  3. getPathByFormat(String nameBeforeDot, String nameAfterDot, Path parent, int i, String date)
  4. getPathCleanName(Path object)
  5. getPathInTmpDir(String fileName)
  6. getPathOfClass(Class cls, String filename)
  7. getPathProperty(Properties props, String propName)
  8. getPaths(Path dir, String fileNames)
  9. getPrefix(final Path file, final int filenameSuffixLength)