本地ftp工具,本地ftp工具java环境配置,连接器地址

本地ftp工具是什么工具,可能有人会回答说不知道,因为一般只有从事网站管理的工作者会使用的多一点。但不是每个人生来就会的,所以刚开始肯定都会学习怎么使用。本地ftp工具该如何进行连接,如何配置呢?这篇文章就来告诉大家本地ftp工具的连接器地址和java环境配置详情。

使用工具:IIS7服务器管理工具

说实话,这个工具算是比较好的管理工具了。里面的功能除了批量管理,还有很多别的功能,主要也是功能也比较全面,相信大多数使用的网站工作人员都比较熟悉了。它里面还能够定时上传下载、定时备份和主动更新。把你花在更新上的经历都省了。

IIS7服务器管理工具除了在ftp上面有这么多的功能以外,它别的功能也都是比较实用的。适用在Windows和liunx操作系统。还支持Vnc和Ftp批量操作。同时它还具有同步操作、到期提醒、数据安全和定期执行的功能。我是挺喜欢的,使用比较便捷。

下载地址:IIS7服务器管理工具

image

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:uploadindex.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();
}
}

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;

}​

评论

暂无评论