Java File Name Get getFileName(String filePath)

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

Description

get File Name

License

Open Source License

Declaration

public static String getFileName(String filePath) 

Method Source Code

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

import java.io.File;

public class Main {
    public static String getFileName(String filePath) {
        File f = new File(filePath);
        if (f.exists()) {
            return f.getName();
        } else {//  w w  w.  j a v a  2s  .c o  m
            return null;
        }
    }
}

Related

  1. getFileName(String filePath)
  2. getFileName(String filePath)
  3. getFileName(String filepath)
  4. getFileName(String filePath)
  5. getFileName(String filePath)
  6. getFilename(String filePath)
  7. getFileName(String folder, final String path)
  8. getFilename(String fullFilename)
  9. getFileName(String localRootDirName, String ending)