I am having fun (sort of) developing a Java 7 FileSystem implementation for use with FTP servers; for this I need an FTP client library (for the runtime aspect) and an FTP server library (for tests).
So, let us start with...
FileSystem is an abstraction, introduced in Java 7, allowing to accessing a tree of
Paths. Think directories and files and you won't be far from reality (note that symbolic link support is also there but we will get it out of the picture for now).
FileSystem is a collection of
FileSystem can potentially have more than one
FileStore but this is FTP; only one
FileStore (see here). One important aspect of a
FileStore is that it describes what "attributes" are available (see
Once you have implemented
Path, you can then do such niceties as, for instance, copy a remote file to a local file using
final Path ftpsrc = ftpfs.getPath(somePathHere); // Paths.get() gets a path from the default JRE filesystem final Path localdst = Paths.get(somePathHere); Files.copy(ftpsrc, localdst);
The client side
What I need on the client side is a minimal library to implement FTP with at least basic authentication support, passive/active mode, binary transfer mode, SSL/TLS support. Download resume is not required.
Right now, my choice is:
It has good reputation, its license matches my needs (I will eventually publish the project using dual LGPLv3/ASL 2.0 licensing) and implements all I want.
But it implements much more than FTP proper. While it does the job, it looks like a 2 squared-mile brick to squash a mouse. Is there an alternative library with as friendly a license as this one but doesn't try and implement anything beyond FTP?
The server side
What is needed here is a pure Java implementation; I need to be able to instantiate an FTP serve so that I can test my implementation against it. Right now, I have elected this one:
The reasons I have chosen it are pretty much the same as for commons-net. But maybe there is a better one?