Here you can find the source of getName(Path path)
Parameter | Description |
---|---|
path | the path to the file or directory. |
public static String getName(Path path)
//package com.java2s; import java.nio.file.*; public class Main { /**//from ww w . j a v a 2 s . c o m * Returns the name of the file or directory from the given path. * * @param path the path to the file or directory. * @return the name of the file or directory. */ public static String getName(Path path) { return path.getFileName().toString(); } }