推荐一款ftp客户端工具:iis7服务器管理工具
IIS7服务管理器,它最优秀的功能就是可以批量管理,适用于Windows系统,Linux系统和VPS服务器等,能极大的提高站长及服务器运维人员工作效率。
同时iis7服务器管理工具还是vnc客户端,服务器真正实现了一站式管理,可谓是非常方便。ftp下载工具是一个免费开源的FTP客户端软件,分为客户端版本和服务器版本,具备所有的FTP软件功能。它还可以管理各系统服务器(win系统和linux)除此之外,还可以管理vnc,可谓非常强大,关键是免费的!
在众多好用实用的功能当中,最大的亮点还是属定时上传下载的强大功能了,它可以定时备份,自动更新等,大家都在用,还等什么呢~
下载地址:iis7服务器管理工具
IIS7服务管理器,它最优秀的功能就是可以批量管理,适用于Windows系统,Linux系统和VPS服务器等,能极大的提高站长及服务器运维人员工作效率。
同时iis7服务器管理工具还是vnc客户端,服务器真正实现了一站式管理,可谓是非常方便。ftp下载工具是一个免费开源的FTP客户端软件,分为客户端版本和服务器版本,具备所有的FTP软件功能。它还可以管理各系统服务器(win系统和linux)除此之外,还可以管理vnc,可谓非常强大,关键是免费的!
在众多好用实用的功能当中,最大的亮点还是属定时上传下载的强大功能了,它可以定时备份,自动更新等,大家都在用,还等什么呢~
下载地址:iis7服务器管理工具

FtpTransferUtil.java工具类,向ftp上传或下载文件:
package utils; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPClientConfig; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; /** * * @ClassName: FtpTransferJob * @Description: 定时迁移数据到FTP上,迁移后删除源数据 * @author Comsys-dell * @date 2017年11月13日 上午9:20:45 * */ public class FtpTransferUtil { public final static String URL="192.168.0.110"; public final static int PORT=21; public final static String USERNAME="ftp_passport"; public final static String PASSWD="ftp_pwd"; /** * Description: 向FTP服务器上传文件 * @param url FTP服务器hostname * @param port FTP服务器端口 * @param username FTP登录账号 * @param password FTP登录密码 * @param path FTP服务器保存目录 * @param filename 上传到FTP服务器上的文件名 * @param input 输入流 * @return 成功返回true,否则返回false */ public static boolean uploadFile(String path, String filename, InputStream input) { boolean success = false; FTPClient ftp = new FTPClient(); try { int reply; ftp.connect(URL, PORT);//连接FTP服务器 //如果采用默认端口,可以使用ftp.connect(url)的方式直接连接FTP服务器 ftp.login(USERNAME, PASSWD);//登录 reply = ftp.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftp.disconnect(); return success; } ftp.changeWorkingDirectory(path); ftp.storeFile(filename, input); input.close(); ftp.logout(); success = true; } catch (IOException e) { e.printStackTrace(); } finally { if (ftp.isConnected()) { try { ftp.disconnect(); } catch (IOException ioe) { } } } return success; } /** * Description: 从FTP服务器下载文件 * @param url FTP服务器hostname * @param port FTP服务器端口 * @param username FTP登录账号 * @param password FTP登录密码 * @param remotePath FTP服务器上的相对路径 * @param fileName 要下载的文件名 * @param localPath 下载后保存到本地的路径 * @return */ public static boolean downFile(String url, int port,String username, String password, String remotePath,String fileName,String localPath) { boolean success = false; FTPClient ftp = new FTPClient(); try { int reply; ftp.connect(url, port); //如果采用默认端口,可以使用ftp.connect(url)的方式直接连接FTP服务器 //ftp.enterLocalPassiveMode(); //设置访问被动模式 ftp.setRemoteVerificationEnabled(false); ftp.enterLocalPassiveMode(); //设置linux环境 FTPClientConfig conf = new FTPClientConfig( FTPClientConfig.SYST_UNIX); ftp.configure(conf); ftp.login(username, password);//登录 reply = ftp.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftp.disconnect(); return success; } ftp.setFileType(FTP.BINARY_FILE_TYPE); boolean dir =ftp.changeWorkingDirectory(remotePath);//转移到FTP服务器目录 FTPFile[] fs = ftp.listFiles(); for(FTPFile ff:fs){ if(ff.getName().equals(fileName)){ File dirFile = new File(localPath); if(!dirFile.exists()){ dirFile.mkdir(); } File localFile = new File(localPath+"/"+ff.getName()); OutputStream is = new FileOutputStream(localFile); ftp.retrieveFile(ff.getName(), is); is.close(); } } ftp.logout(); success = true; } catch (Exception e) { e.printStackTrace(); } finally { if (ftp.isConnected()) { try { ftp.disconnect(); } catch (IOException ioe) { } } } return success; } public static void main(String[] args) { } }
使用的jar包在下面截图中: