public static String getName(String filename) {
        if (filename == null) {
            return null;
        }
        int index = indexOfLastSeparator(filename);
        return filename.substring(index + 1);
    }
public static String getName(String filename) {
        if (filename == null) {
            return null;
        }
        int index = indexOfLastSeparator(filename);
        return filename.substring(index + 1);
    }
public static String getName ( String filename ) { if ( filename == null ) { return null ; } int index = indexOfLastSeparator ( filename ) ; return filename . substring ( index + 1 ) ; }
Gets the name minus the path from a full filename.
<p>
This method will handle a file in either Unix or Windows format.
The text after the last forward or backslash is returned.
<pre>
a/b/c.txt --> c.txt
a.txt     --> a.txt
a/b/c     --> c
a/b/c/    --> ""
</pre>
<p>
The output will be the same irrespective of the machine that the code is running on.

@param filename  the filename to query, null returns null
@return the name of the file without the path, or an empty string if none exists
Gets the name minus the path from a full filename . <p > This method will handle a file in either Unix or Windows format . The text after the last forward or backslash is returned . <pre > a / b / c . txt -- > c . txt a . txt -- > a . txt a / b / c -- > c a / b / c / -- > < / pre > <p > The output will be the same irrespective of the machine that the code is running on .