ftp软件,系统自带ftp工具
文章目录
ftp工具是一种文件传输下载方式,它是TCP/IP协议栈的一部分;其中FTP又由两部分组成,一部分是FTP的服务器,另一部分是FTP的客户端!它能够高效安全地进行文件传输下载操作!可以使用服务器管理工具来作为FTP的客户端,进行FTP的操作,实现FTP的下载安装。接下来介绍系统自带ftp工具如何进行java配置。
使用工具:IIS7服务器管理工具
这款软件的ftp工具做的是非常棒的,不仅具有批量操作功能,还具有定时同步(上传和下载)和自动更新功能。这些功能真的是我超爱的功能,做事效率提高了不止一星半点。而且特别容易上手,一般的软件都还需要熟悉一下,这个就是很快的能开始运用。好处很多,需要用户慢慢去体会。有的东西是只能亲身体验过后才知道的。
IIS7服务器管理工具所包含的功能是比较多比较全面的,开发者从各个角度都做到了为用户着想,这点是非常棒的。毕竟一款软件要想有发展前途,那必须是要用户体验好。这款IIS7服务器管理工具可以进行批量管理、同步操作、到期提醒、数据安全和定期执行。IIS7服务器管理工具无论是传输速度还是安全性都是非常优秀的一款软件了。相信我,你们入股这款工具绝对不亏。
下载地址:[IIS7服务器管理工具](http://fwqglgj.iis7.net/cp/ft...
)


java下配置连接FTP:
public void putTxtToFTP() {
System.out.println("开始执行定时器任务:维系一键订单量!");
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, -1); //得到前一天
Date date = calendar.getTime();
SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
String yesterday = df.format(date);
StringBuffer yjtjOrderTxt = new StringBuffer();
yjtjOrderTxt.append("yjtywx_").append(yesterday).append(".txt");
List<WxActiveData> yjtjOrderList = activeDataService.wxGetYjtjOrder();
//FtpUtil ftpUtil = new FtpUtil("hexin","hx105155","134.64.105.155", "/yjtydd"); //测试库FTP
FtpUtil ftpUtil = new FtpUtil("ahftp","ahdx@#$_123dic","192.168.0.28", "/yjtydd");
PrintWriter printWriter = null;
File highFeeFile = new File(Contants.FILE_PATH_BAK + yjtjOrderTxt);//Contants.FILE_PATH_BAK = "/opt/wss/domains/tmp/"
// File highFeeFile = new File("D:/" + highFeeTxt);
// File gjmyFile = new File("D:/" + gjmyTxt);
//File highFeeFile = new File("D:/" + yjtjOrderTxt);
try {
printWriter = new PrintWriter(new FileWriter(highFeeFile, true));
for (int i = 0; i < yjtjOrderList.size(); i++){
printWriter.println(yjtjOrderList.get(i).toString().trim());
}
} catch (IOException e) {
System.out.println("主动服务 高额数据报表任务异常!");
}finally{
printWriter.close();
}
if(highFeeFile.exists()){
System.out.println("主动服务定时器任务 高额数据 上传成功"+yjtjOrderTxt.toString());
ftpUtil.uploadFile(highFeeFile, yjtjOrderTxt.toString());
}else{
System.out.println("主动服务定时器任务 高额数据 上传失败"+yjtjOrderTxt.toString());
}
System.out.println("服务器批量查排名-查询结果");
}
public ActiveDataService getActiveDataService() {
return activeDataService;
}
public void setActiveDataService(ActiveDataService activeDataService) {
this.activeDataService = activeDataService;
}Java配置方式:
import com.enterprisedt.net.ftp.*;
public class FtpClient {
static FTPClient ftpClient;
public FtpClient(){};
String remoteAddress=“192.168.168.33”,userName=“cattsoft”,password=“cattsoft”;
public void DownLoad(){
try{
FTPClient client = new FTPClient();
client.setRemoteHost(remoteAddress);
client.connect();
client.login(userName,password);
client.setType(FTPTransferType.BINARY);
client.get(“E:\upload\index.jsp”,"/home/cattsoft/jakarta-tomcat-5.0.28/webapps/vip/dkf/index2.jsp");
client.quit();
System.out.println(“下载成功...”);
}catch(Exception e){
e.printStackTrace();
System.out.println(“下载失败...”);
}
}
public static void main(String[] args){
FtpClient fc = new FtpClient();
fc.DownLoad();
}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论