Import Sun.Net.ftp.ftpclient; Import Java.io. *; Import Sun.Net. *;
Public class ftpdown {public ftpdown () {} public static void main (string [] args) {try {ftpclient fc = new ftpclient ("192.168.55.112"); fc.login ("root", "123123"); int CH; file fi = new file ("c: //sun-appserver7-solaris-i86pc-ur6.tar.gz"); randomaccessfile getfile = new randomaccessfile (Fi, "RW"); getFile.seek (0); TelNetinputStream FGET = fc.get ("/ export / home / Aigo / Sun-Appserver7-Solaris-i86PC-UR6.TAR.GZ"); DataInputStream Puts = New DataInputStream (FGET); while ((ch = Puts.Read ()) > = 0) {getFile.Write (); fget.close (); getfile.close (); fc.closeServer ();} catch (ooException ex) {EX.PrintStackTrace ();}}}
I am Download Unix is Dongdong. . . Java ftpdown error. . . ---------- Java ---------- Sun.Net.telnetProtocolexception: misplaced cr in infutat sun.net.telnetInputStream.read (TelnetInputStream.java: 93) at java.io. FilterInputStream.read (FilterInputStream.java: 66) at ftpdown.main (ftpdown.java: 22) Normal Termination output (time consuming 0 seconds).
fc.binary ();