public Vector mlsd(String path)
        throws ServerException, ClientException, IOException {

        ByteArrayDataSink sink = new ByteArrayDataSink();

        mlsd(path, 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();
        MlsxEntry entry = null;
        String line = null;

        while ((line = reader.readLine()) != null) {

            if (logger.isDebugEnabled()) {
                logger.debug("line ->" + line);
            }

            try {
                entry = new MlsxEntry(line);
            } catch (FTPException e) {
                ClientException ce =
                    new ClientException(
                                        ClientException.UNSPECIFIED,
                                        "Could not create MlsxEntry");
                ce.setRootCause(e);
                throw ce;
            }

            fileList.addElement(entry);

        }
        return fileList;
    }
public Vector mlsd ( String path ) throws ServerException , ClientException , IOException { ByteArrayDataSink sink = new ByteArrayDataSink ( ) ; mlsd ( path , sink ) ; ByteArrayOutputStream received = sink . getData ( ) ; BufferedReader reader = new BufferedReader ( new StringReader ( received . toString ( ) ) ) ; Vector fileList = new Vector ( ) ; MlsxEntry entry = null ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "line ->" + line ) ; } try { entry = new MlsxEntry ( line ) ; } catch ( FTPException e ) { ClientException ce = new ClientException ( ClientException . UNSPECIFIED , "Could not create MlsxEntry" ) ; ce . setRootCause ( e ) ; throw ce ; } fileList . addElement ( entry ) ; } return fileList ; }
Performs remote directory listing on the given path.
Sends 'MLSD &lt;path&gt;' command.

@param path directory to perform listing of. If null, listing
of current directory will be performed.
@return Vector list of {@link MlsxEntry MlsxEntry} objects, representing
remote files