FTP - way to programatically determine time remaining or bytes transfered?(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 - 以编程方式确定剩余时间或传输字节的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:FTP - 以编程方式确定剩余时间或传输字节的方法


- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01