public Vector list ( String filter , String modifier ) throws ServerException , ClientException , IOException { ByteArrayDataSink sink = new ByteArrayDataSink ( ) ; list ( filter , modifier , sink ) ; ByteArrayOutputStream received = sink . getData ( ) ; // transfer done. Data is in received stream. // convert it to a vector. BufferedReader reader = new BufferedReader ( new StringReader ( received . toString ( ) ) ) ; Vector fileList = new Vector ( ) ; FileInfo fileInfo = null ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "line ->" + line ) ; } if ( line . equals ( "" ) ) { continue ; } if ( line . startsWith ( "total" ) ) continue ; try { fileInfo = new FileInfo ( line ) ; } catch ( FTPException e ) { ClientException ce = new ClientException ( ClientException . UNSPECIFIED , "Could not create FileInfo" ) ; ce . setRootCause ( e ) ; throw ce ; } fileList . addElement ( fileInfo ) ; } return fileList ; }
Performs remote directory listing with the specified filter and modifier . Sends LIST &lt ; modifier&gt ; &lt ; filter&gt ; command .