I have a bean, FTPBean (and a mating FTPException class) that will work for you. It's got Javadoc comments so it should be pretty easy to figure out.
This code is OLD (I mean like 10 years old) and is based on another older piece of code (I believe it was named Linlyn or something like that) that was floating around for YEARS.
There's quite a bit of code so pasting here probably isn't a real good idea. I've gone ahead and placed a ZIP file with the two classes in it at http://www.lamatek.com/documents/FTP.zip. They're packaged in a net.foamtapes.beans package, feel free to do whatever with them, repackage, modify, whatever.
HTH.