Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

Java FTP client libraries reviewed

Learn how the available libraries stack up against each other

  • Print
  • Feedback

Page 2 of 7

  • It fundamentally differs from the third-party FTP client libraries; these implement RFC959 rather than RFC1738.
  • RFC959 is implemented in most desktop FTP-client tools. Many Java programmers use these tools to connect to FTP servers. As a matter of taste, these tools most likely prefer RFC959-like libraries.
  • The URL and URLConnection classes only open streams for communication. The Sun library offers no straight support for structuring the raw FTP server responses into more usable Java objects like String, File, RemoteFile, or Calendar. So we have to write more code just to write data into a file or to exploit a directory listing.
  • As explained in section 3.2.5 of RFC1738, "Optimization," FTP URLs require that the (control) connection close after every operation. This is wasteful and not efficient for transferring many small files. Furthermore, extremely restrictive FTP servers may consider such a communication overhead as an evil network attack or abuse and deny further service.
  • Finally, it lacks several useful features.


For all or any of these reasons, using a third-party library is preferable. The following section lists the available third-party alternatives.

Library comparison

The list below outlines the libraries I compare throughout this article. They all follow the reference FTP specification. Below, I mention the provider name and the library name (in italics). Resources includes links to each product Website. To jumpstart library use, I also mention the main FTP client class.

  1. JScape, iNet Factory: com.jscape.inet.ftp.Ftp
  2. /n software, IP*Works: ipworks.Ftp
  3. Enterprise Distributed Technologies, Java FTP Client Library: com.enterprisedt.net.ftp.FTPClient
  4. IBM alphaWorks, FTP Bean Suite: com.ibm.network.ftp.protocol.FTPProtocol
  5. SourceForge, JFtp: net.sf.jftp.net.FtpConnection
  6. The Jakarta Project, Jakarta Commons/Net: org.apache.commons.net.ftp.FTPClient
  7. JavaShop JNetBeans: jshop.jnet.FTPClient
  8. Sun, JDK: sun.net.ftp.FtpClient
  9. Florent Cueto, JavaFTP API: com.cqs.ftp.FTP
  10. Bea Petrovicova, jFTP: cz.dhl.ftp.Ftp
  11. The Globus Project, Java CoG Kit: org.globus.io.ftp.FTPClient


Notes:

  • At the time of this writing, IBM is evaluating the suitability of offering its alphaWorks FTP Bean Suite on its Website. For now, download is closed for all users.
  • Jakarta Commons/Net is a drop-in replacement for Savarese NetComponents, which is no longer developed.
  • JavaShop JNetBeans seems to have been abandoned. At the time of this writing, the site has been off-line for more than a month, and I never received any answers to my support requests.


Criteria

So far, I have introduced the context and listed the available libraries. Now, I list the relevant criteria against which each library will be evaluated. I enumerate possible values for each criterion, along with the abbreviation (in bold) used in the final comparison matrix.

Product support

The libraries provide support to users through product documentation, compiled Javadocs, sample code, and an example application that can include comments and explanations. Additional support can be offered to users through forums, mailing lists, a contact email address, or an online bug tracking system. /n software offers extensive support for an additional fee.

  • Print
  • Feedback

Resources