我应该使用什么 JavaFTP 客户端库?

因为我的 最后问题没有得到肯定的回答。我将尝试自己编写一个 JavaFTP 上传小程序。

我的问题是: “你能推荐一个 JavaFTP 客户端库供我使用吗?”

我希望是:

  • 稳定
  • 能够处理被动和主动模式
  • 能够提供上传进度信息
  • 如果出现错误,则抛出可捕捉的异常(特别是当上传不成功时)
  • 便宜[免费]使用,最好是开源的

我找到了一些图书馆的 这个 概述,但由于这篇文章是从2003年开始的,可能有一些新的发展:)

115509 次浏览

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!

You have also this 2006 article which lists different options for FTP clients.

commons-net is good, but FTP-GO can give you some of the more advanced features you are looking for.

kagi Ftp-Go

Commons-net surely. :) Most open source projects use it these days.

yc

I have successfully used the Enterprise DT FTP library, 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.

Apache commons-nets get updates more frequently recently, while Enterprise DT library seems to update even more frequently.

Yes, EnterpriseDT's edtFTPj is stable (first released in 2000), has all the features you might need, and is open source as well.

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.

ftp4j is the best one, both for features and license:

http://www.sauronsoftware.it/projects/ftp4j/

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.

ftp4j ftw