引用org.apache.commons.net.ftp.*linux
FTPFile[] fs = ftpClient.listFiles();apache
获取指定目录文件名列表,windows
以前一直这样用,在linux上和windows上都没问题,今天不知道为何fs长度一直是0,没法获取文件列表错误提示:eclipse
org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array.测试
并且fs不会阻塞住。.net
在网上找资料,说加上ftpClient.enterLocalPassiveMode();debug
测试可以读取ftp文件列表component
参考:http://www.iteye.com/problems/39038blog
http://icelander.iteye.com/blog/1313986ip
第二个网址对ftpClient.enterLocalPassiveMode()的解释和我遇到的问题不一样