Java Path File Name nio getFileNameFromPath(String filePath)

Here you can find the source of getFileNameFromPath(String filePath)

Description

get File Name From Path

License

Open Source License

Declaration

public static String getFileNameFromPath(String filePath) 

Method Source Code

//package com.java2s;
/*/* w ww . j av  a 2  s .c o  m*/
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the license found in the LICENSE file in
 * the root directory of this source tree.
 */

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

public class Main {
    public static String getFileNameFromPath(String filePath) {
        Path p = Paths.get(filePath);
        return p.getFileName().toString();
    }
}

Related

  1. getFileName(Path path)
  2. getFileName(Path path)
  3. getFileName(String fullPath, boolean withParentFolder)
  4. getFileName(String path)
  5. getFileName(String relativePath)
  6. getFileNameFromPath(String str)
  7. getFilenameOrLastPath(String path)
  8. getFileNames(List fileNames, Path dir)
  9. getFileNames(List fileNames, Path dir, String ext, boolean recursive)