Here you can find the source of getFileName(File file)
Parameter | Description |
---|---|
file | the file |
public static String getFileName(File file)
//package com.java2s; /*/*from w w w . j av a2 s.c o m*/ * This software is distributed under the terms of the FSF * Gnu Lesser General Public License (see lgpl.txt). * * This program is distributed WITHOUT ANY WARRANTY. See the * GNU General Public License for more details. */ import java.io.File; public class Main { /** * Returns file name. * * @param file the file * @return name of the file */ public static String getFileName(File file) { return (file != null) ? file.getName() : ""; } }