public String getName ( ) { String r = remote ; if ( r . endsWith ( "\\" ) || r . endsWith ( "/" ) ) r = r . substring ( 0 , r . length ( ) - 1 ) ; int len = r . length ( ) - 1 ; while ( len >= 0 ) { char ch = r . charAt ( len ) ; if ( ch == ' ' || ch == ' ' ) break ; len -- ; } return r . substring ( len + 1 ) ; }
Gets just the file name portion without directories .