前几天用FTP实现了一个批量下载附件功能
1. 我用到的是FTPClient(org.apache.commons.net.ftp.FTPClient)类
/**
* 获得FTP客户端
* @param hostName 主机名称
* @param username 用户账号
* @param password 密码
* @return FTPClient引用
*/
public static FTPClient getFTPClient(String hostName, String username , String password,int port) throws IOException {
FTPClient ftpClient = new FTPClient();
port = port == 0 ?21:por