use the "ftp" command. Most implementations I've seen so far are
capable of working when called in a script, so the easiest thing you
can do in Java is generate a script file (under Windows a .BAT file)
which contains user name and password for the FTP connection, sets to
no-prompt mode, sets ftp to binary or ASCII mode (whichever is
appropriate), and finally transfers the necessary file(s). Then you
simply call FTP by (usually) executing something like this:
Runtime .exec( "ftp <" + scriptFileName);