public static String getFileName ( String filePath ) { if ( filePath == null ) { return filePath ; } int index = filePath . lastIndexOf ( File . separator ) ; if ( index == - 1 ) { return filePath ; } return filePath . substring ( index + 1 ) ; }
Get file name from a file path