对于ftp下载文件 如果服务器地址不是本地,而是在虚拟机上或者在某个服务器上,
在传路径想new 一个File时候 ,绝对不能用java.io.File类的,因为它只能new 路径 是本地电脑上的
这时候需要用org.apache.commons.net.ftp.FTPFile类 来new 想要下载的文件。!!!
其次就是 如果服务器是linux系统 ,它和windows是不一样的,需要加上两行代码
其次对于详细代码 ,请参考这位哥的文章
http://www.cnblogs.com/tiandi/p/5936218.html