List<String> list = connection.getFastDirectoryListing(); for(String s : list) { log.debug("FastList: " + s); }
    public static void main(String args[])    {        Logger log = Logger.getLogger("MAIN");                Properties pt = new Properties();        pt.setProperty("connection.host","127.0.0.1");        pt.setProperty("connection.port","21");        pt.setProperty("user.login","ftpuser");        pt.setProperty("user.password","ftp4che");        pt.put("connection.type", new Integer(FTPConnection.AUTH_TLS_FTP_CONNECTION));        pt.put("connection.timeout",new Integer(10000));        pt.put("connection.passive",new Boolean(true));        try        {            FTPConnection connection = FTPConnectionFactory.getInstance(pt);            log.debug("user:" + connection.getUser());            try            {                connection.connect();//                connection.getWorkDirectory();//                connection.makeDirectory("testdir");//                connection.changeDirectory("testdir");//                log.debug("Working Directory: " + connection.getWorkDirectory());                    //                connection.changeToParentDirectory();                //                connection.removeDirectory("testdir");                //                log.debug("Working Directory: " + connection.getWorkDirectory());                //                connection.noOperation();//                connection.changeDirectory("/home/ftpuser/download");//                connection.getWorkDirectory();////                connection.makeDirectory("testdir");//                connection.changeDirectory("testdir");//                log.debug("Working Directory: " + connection.getWorkDirectory());    //                //                connection.changeToParentDirectory();//                //                connection.removeDirectory("testdir");//                //                log.debug("Working Directory: " + connection.getWorkDirectory());//                //                connection.noOperation();//                connection.changeDirectory("/home/ftpuser/download");                List<FTPFile> fileList = connection.getDirectoryListing();                for(int i = 0; i < fileList.size(); i++)                    log.info("Name:" + fileList.get(i).getName() + " Mode:" + fileList.get(i).getMode() + " Date:" + fileList.get(i).getDate() + " Size:" + fileList.get(i).getSize());                log.debug("List Size:" + fileList.size());/*                FTPFile fromFile = new FTPFile();                fromFile.setName("testfile1.doc");                connection.downloadFile(fromFile,new File("/home/ftpuser/download/testfile1.doc"));                connection.changeDirectory("/home/ftpuser/upload");                connection.uploadFile(new File("/home/ftpuser/download" + File.separator + "testfile1.doc"),new FTPFile("testfile1.doc"));                connection.changeDirectory("/home/ftpuser/download");  */                              connection.disconnect();            }catch (NotConnectedException nce)            {                log.error(nce);            }            catch (IOException ioe)            {                log.error(ioe);            }            catch (Exception e)            {                log.error(e);            }        }catch(ConfigurationException ce)        {            log.error(ce);        }    }