FTP - 以编程方式确定剩余时间或传输字节的方法?

FTP - way to programatically determine time remaining or bytes transfered?(FTP - 以编程方式确定剩余时间或传输字节的方法?)
本文介绍了FTP - 以编程方式确定剩余时间或传输字节的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我想建立一个 FTP 连接(最好使用 Coldfusion 8,但 Java 也可以),它将文件复制到远程服务器.

I want to make an FTP connection (ideally using Coldfusion 8, but Java is fine too) that will copy a file to a remote server.

然而,至关重要的是,我想知道已经传输了多少字节,以便向用户提供一些反馈.

Crucially however, I want to know how many bytes have been transferred so I can give some feedback to the user.

这可能吗?如果是的话,您会推荐什么 FTP API,因为我了解 Sun 的实现可能有点欠缺.

Is this possible, and if so what FTP API would you recommend as I understand the Sun implementation may be a bit lacking.

提前致谢!

PS:在传输文件时,我可以让另一个进程/线程通过 Web 服务调用轮询目标计算机上的文件大小,但这并不理想.通过 FTP API 获取它是最好的解决方案.

PS: I could have another process/thread poll the file size on the destination machine via a web service call while the file is being transferred but it's not ideal. Getting it through FTP API would be the neatest solution.

推荐答案

这个关于 CodeRanch 的讨论 包含的片段展示了如何结合 Apache commons FtpClient 实现进度监视器.

This discussion on CodeRanch includes snippets that show how a progress monitor can be implemented in conjunction with Apache commons FtpClient.

这篇关于FTP - 以编程方式确定剩余时间或传输字节的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

java8 stream sum multiple(java8流总和倍数)
How to output the decimal in average?(如何平均输出小数?)
Java sum 2 negative numbers(Java求和2个负数)
How to get sum of char values produced in a loop?(如何获得循环中产生的 char 值的总和?)
How can I sum the values associated with a reoccurring key in a hashmap(如何将与哈希图中重复出现的键关联的值相加)
subset sum find all subsets that add up to a number(子集和找到所有加起来为一个数字的子集)