@@ -0,0 +1,1696 @@
+package org.apache.commons.net.ftp;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Comparator;%0A%0Aimport org.apache.commons.net.ftp.FTPClient;%0Aimport org.apache.commons.net.ftp.FTPFile;%0Aimport org.apache.commons.net.ftp.FTPReply;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Apublic class FTPClientTest %7B%0A    private final static Logger logger = LoggerFactory.getLogger(FTPClientTest.class);%0A%0A    @Test%0A    public void testListFiles() throws Exception %7B%0A%09// http://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java%0A%09FTPClient ftp = new FTPClient();%0A%09// FTPClientConfig config = new FTPClientConfig();%0A%09ftp.connect(%22192.168.201.126%22, 21);%0A%09int reply = ftp.getReplyCode();%0A%09%0A%09if (!FTPReply.isPositiveCompletion(reply)) %7B%0A%09    ftp.disconnect();%0A%09%7D%0A%09boolean b = ftp.login(%22jrchens%22, %22Xxcdy@110609%22);%0A%09logger.info(%22login %7B%7D%22,b ? %22success%22 : %22error%22);%0A%09%0A%09%0A%09FTPFile%5B%5D fs = ftp.listFiles(%22w%22); %0A%09Arrays.sort(fs, new Comparator%3CFTPFile%3E()%7B%0A%09    @Override%0A%09    public int compare(FTPFile o1, FTPFile o2) %7B%0A%09%09return Long.valueOf(o2.getTimestamp().getTimeInMillis()).compareTo(o1.getTimestamp().getTimeInMillis());%0A%09    %7D%0A%09%7D);%0A%09%0A%09logger.info(%22filename: %7B%7D%22,fs%5B0%5D.getName());%0A%09%0A//%09for (FTPFile ftpFile : fs) %7B%0A//%09    System.out.println(String.format(%22%25s, %25d%22, ftpFile.getName(),ftpFile.getTimestamp().getTimeInMillis()));%0A//%09%7D%0A%09%0A%09fs = ftp.listFiles(); %0A%09Arrays.sort(fs, new Comparator%3CFTPFile%3E()%7B%0A%09    @Override%0A%09    public int compare(FTPFile o1, FTPFile o2) %7B%0A%09%09return Long.valueOf(o2.getTimestamp().getTimeInMillis()).compareTo(o1.getTimestamp().getTimeInMillis());%0A%09    %7D%0A%09%7D);%0A%09logger.info(%22filename: %7B%7D%22,fs%5B0%5D.getName());%0A%09%0A%09ftp.disconnect();%0A    %7D%0A%0A%7D%0A

add ftpclient test listfiles