我应该使用什么 Java FTP 客户端库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/295178/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What Java FTP client library should I use?
提问by Tader
Since I received no positives answers to my lastquestion. I will try to write a Java FTP upload applet myself.
因为我没有收到对我上一个问题的肯定答案。我会尝试自己写一个Java FTP上传小程序。
My question is: "Can you recommend a Java FTP client library for me to use?"
我的问题是:“你能推荐一个 Java FTP 客户端库供我使用吗?”
I want it to be:
我希望它是:
- stable
- able to handle passive and active modes
- able to provide upload progress information
- throw catchable exceptions if something went wrong (especially when an upload does not succeed)
- cheap/free to use, preferably open source
- 稳定的
- 能够处理被动和主动模式
- 能够提供上传进度信息
- 如果出现问题,则抛出可捕获的异常(尤其是当上传不成功时)
- 便宜/免费使用,最好是开源的
I found thisoverviewof some libraries, but since this article is from 2003, maybe some new developments have happened :)
采纳答案by Leigh
Check out Apache commons-net, which contains FTP utilities. Off the top of my head I'm not sure if it meets all of your requirements, but it's certainly free!
查看包含 FTP 实用程序的Apache commons-net。我不确定它是否满足您的所有要求,但它肯定是免费的!
回答by VonC
You have also this 2006 articlewhich lists different options for FTP clients.
您还有这篇2006 年的文章,其中列出了 FTP 客户端的不同选项。
commons-net is good, but FTP-GOcan give you some of the more advanced features you are looking for.
commons-net 很好,但是FTP-GO可以为您提供一些您正在寻找的更高级的功能。
回答by yclian
Commons-net surely. :) Most open source projects use it these days.
共享网络肯定。:) 现在大多数开源项目都在使用它。
yc
yc
回答by sourcerebels
回答by Cozzman
I have successfully used the Enterprise DT FTPlibrary, which is free and open source. I can't compare it to other libraries (like the Apache Commons Net library) since I haven't used them. It does provide a simple upgrade path to SFTP (over SSH) and FTPS (over SSL), though that is a pay-for commercial product.
我已经成功使用了Enterprise DT FTP库,它是免费和开源的。我无法将它与其他库(如 Apache Commons Net 库)进行比较,因为我没有使用过它们。它确实提供了到 SFTP(通过 SSH)和 FTPS(通过 SSL)的简单升级路径,尽管这是一种付费的商业产品。
回答by Gatorhall
Apache commons-nets get updates more frequently recently, while Enterprise DT library seems to update even more frequently.
Apache commons-nets 最近更新得更频繁,而 Enterprise DT 库似乎更新得更频繁。
回答by Bruce Blackshaw
Yes, EnterpriseDT's edtFTPjis stable (first released in 2000), has all the features you might need, and is open source as well.
是的,EnterpriseDT 的edtFTPj很稳定(于 2000 年首次发布),具有您可能需要的所有功能,并且也是开源的。
It's used in a bunch of open source projects (as well as in many commercial projects), and is acknowledged to be one of the fastest client libraries around.
它被用于大量开源项目(以及许多商业项目),并且被公认为是最快的.
As another poster noted, if you do wish to upgrade to SFTP and/or FTPS, it is a simple upgrade path with very few code changes required.
正如另一位发帖人所指出的,如果您确实希望升级到 SFTP 和/或 FTPS,这是一个简单的升级路径,只需更改很少的代码。
回答by Cocco
ftp4j is the best one, both for features and license:
ftp4j 是最好的,无论是功能还是许可证:
回答by nicolai.tesela
I was downloading video files. Apache's FTPClient fumbled, it downloaded the video reasonably fast. but when I tried to play the video back, it lost chunks out of the middle of the video. ftp4j would download the whole video with no loss.
我正在下载视频文件。Apache 的 FTPClient 失败了,它下载视频的速度相当快。但是当我尝试播放视频时,它丢失了视频中间的大块。ftp4j 会毫无损失地下载整个视频。
ftp4j ftw
ftp4j ftw