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 - 以编程方式确定剩余时间或传输字节的方法
基础教程推荐
- 将 Windows 证书导入 Java 2022-01-01
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- Maven:无效的目标版本:10 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- JPA惰性列表上的流 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
