ftp自动上传工具,ftp自动上传工具的java环境配置和连接器地址

ftp自动上传工具你知道吗,你有特别喜欢的ftp自动上传工具吗,如果你对这方面不懂的话,但是现在又急着用这款的情况下,你刷到了我这篇文章,那么恭喜你,你已经成功了一半了。今天我就来给大家介绍ftp自动上传工具的java环境配置和连接器地址。

工具名称:iis7服务器管理软件

iis7远程桌面管理软件,是一款绿色小巧,功能实用的FTP工具软件,其界面简洁,操作方便,它支持FTP批量上传下载,它可以同时连接多台ftp服务器进行文件传输工作,还可以在线解压缩文件,支持文件查找,在线编辑等功能。
同时它还能够同时远程操作多台服务器,并且多台服务器间可以自由切换,适合机房管理、站长、运维工作、程序员使用。适用于Windows系统,Linux系统和VPS服务器等。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;
}​

评论

暂无评论