首页 > 其他 > 详细

FTP,FTP该如何进行连接,如何配置连接工具

时间:2020-06-18 17:31:11      阅读:72      评论:0      收藏:0      [点我收藏+]

使用FTP上传工具进行远程连接

 

技术分享图片

 

FTP用于在FTP服务器和FTP客户端之间上传和下载文件,它最优秀的功能就是可以批量管理,可以将文件从一个主机传输到另一个主机。

 

地址:FTP上传工具

 

使用FTP上传工具最优秀的功能就是可以批量管理、批量上传,适用于Windows系统,Linux系统和服务器等,能极大的提高站长及服务器运维人员工作效率,同时FTP上传工具还是vnc客户端,真正实现了一站式管理,非常方便。

 

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;

    }

 

FTP,FTP该如何进行连接,如何配置连接工具

原文:https://www.cnblogs.com/Silent-universe/p/13158688.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!