Jean-Christophe Collet's Weblog
Jean-Christophe Collet's Weblog

20080523 Friday May 23, 2008

FTP client API for JDK7

Introduction

For quite a while now I have been working on RFE 4650689 (RFE: Java needs public API for FTP) which has finally been approved for JDK 7 (don't ask).

I figured it's about time I post a draft of the API we've been working on and get some feedback from the community.

First and foremost, you have to realize that we already have an FTP API (see my earlier blog entry on that front) and that the new one has to be compatible with it. We do not want two implementations of the FTP protocol (bloat is bad, Mmmmkay?), so the proposed FTP client has to be usable by the existing protocol handler sun.net.www.protocol.ftp.FtpURLConnection. This had an impact on the design. Basically, we started from the existing code (residing in sun.net.ftp.FtpClient) and extended that.

Supported features

The goal was to support as much as possible of the existing RFCs: 959, 2228, 2389, 2428, and 4217. Some of the features in these RFCs are, however, rather obsolete so we used our best judgment as to what to actually implement. Feel free to correct us if you are convinced we are missing an important part.

The most notable features gained from the new API are:

  • Multiple transfers per session which was not possible with the URL, URLConnection model.
  • Resume interrupted downloads.
  • 'Smart' directory listing with pluggable parser.
  • Directory manipulation: mkdir, rmdir, cd, cdup, pwd.
  • SSL/ftps support, including an FTPS protocol handler to work with URL/URLConnection.

API

If you want more details, check the current draft of the javadoc. Be aware that there is no guarantee that this will be the final API, or even that this feature will make the final JDK 7 cut. It still has to go through the approval process.

Feedback is not only welcome, it is very encouraged. So if you have any remarks, or requests, please drop me a note or, even better, use the openjdk networking email alias.

(2008-05-23 08:14:36.0) Permalink Comments [1]

Comments:

GSSAPI support would be a very userful feature. I know plenty of developers who would love it :)

Posted by Jason Richardson on May 23, 2008 at 07:35 PM CEST #

Post a Comment:

Comments are closed for this entry.

archives
links
referers