import sun.net.ftp.*;
String server = "ftp.fileplanet.com";
String user = "me";
String passwd = "1234";
FtpClient client = new FtpClient();
client.openServer(server);
client.login(user, passwd);
client.binary();//
client.cd("games");
////DO NOT CLOSE THIS INPUTSTREAM UNTIL YOU WANT TO CLOSE YOUr CONNECTION
TelnetInputStream in = client.get("pacman.exe");
//now do whatever u want with this inputstream