private Map < String , Long > listFiles ( ) throws FtpException { int attempts = 0 ; Map < String , Long > files = new LinkedHashMap < String , Long > ( ) ; while ( true ) { try { FTPListParseEngine engine = null ; if ( type . startsWith ( "UNIX" ) ) { engine = ftpClient . initiateListParsing ( FTPClientConfig . SYST_UNIX , null ) ; } else { engine = ftpClient . initiateListParsing ( ) ; } FTPFile [ ] list = engine . getFiles ( ) ; if ( list != null ) { for ( FTPFile ftpFile : list ) { files . put ( ftpFile . getName ( ) , ftpFile . getSize ( ) ) ; } } return files ; } catch ( Exception e ) { attempts ++ ; if ( attempts > 3 ) { throw new FtpListFilesException ( e ) ; } else { LOGGER . trace ( "First attempt to get list of files FAILED! attempt={}" , attempts ) ; } } } }
List files inside the current folder .