rzvika3
asked on
ftp commands
Hi
I want to create an ftp application using Java.
Can i find a ready one?
If not, where can i find how to invoke ftp commands?
I want to create an ftp application using Java.
Can i find a ready one?
If not, where can i find how to invoke ftp commands?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hope that helps. If you decide that this suites you I'll give you the full API to the FtpClient class.
A cool one at :
http://www.iit.edu/~harejoh/jftp/jftp_home.html
http://www.iit.edu/~harejoh/jftp/jftp_home.html
Looks cool man.
ASKER
excellent!!!
BUT, i can't see the source code ;-)
do you know about such application that i can use its source code?
Gadio:
------
can you send me the full api? my email is: s2794372@t2.technion.ac.il
Pyxide:
-------
i create a question for you, thank you!
(if you can, tell me how i can get its source code by the classes)
BUT, i can't see the source code ;-)
do you know about such application that i can use its source code?
Gadio:
------
can you send me the full api? my email is: s2794372@t2.technion.ac.il
Pyxide:
-------
i create a question for you, thank you!
(if you can, tell me how i can get its source code by the classes)
use jad the best and the fastest java Decompiler on Planet Earth
http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
import sun.net.*;
import sun.net.ftp.*;
import java.io.*;
public class ftp_utility {
public ftp_utility () {
FtpClient fcMyFtp = new FtpClient();
try {
int ch;
fcMyFtp.openServer("myftpsite");
fcMyFtp.login("myname","mypassword")
TelnetInputStream tisList = fcMyFtp.list();
while( (ch = tisList.read()) != -1 ) System.out.print((char)ch)
// ... other stuff.
fcMyFtp.cd("temp");
fcMyFtp.binary();
// writing a file:
FileInputStream fis = new FileInputStream( "/home/gadio/temp/tempfile
" );
TelnetOutputStream tos = fcMyFtp.put("tempfile.new");
byte buffer[] = new byte[1000];
int len;
while( (len = fis.read(buffer)) != -1 ) {
tos.write(buffer,0,len);
}
fis.close();
tos.close();
// reading a file:
FileOutputStream fos = new FileOutputStream( "/home/gadio/temp/tempfi
le.read" );
TelnetInputStream tis = fcMyFtp.get("tempfile.new");
while( (len = tis.read(buffer)) != -1 ) {
fos.write(buffer,0,len);
}
tis.close();
fos.close();
} catch( IOException e ) {
e.printStackTrace();
}
}
public static void main(String args[]) {
ftp_utility f = new ftp_utility();
}
}