My name is Ravi Pal.
I was wondering how to use FTP in java code.
Will some body help me.
Thx.
-
FTP usage in Java (3 messages)
- Posted by: ravi pal
- Posted on: August 01 2001 04:31 EDT
Threaded Messages (3)
- FTP usage in Java by Tim Pouyer on August 01 2001 10:54 EDT
- FTP usage in Java by Weston Aiken on August 09 2001 07:50 EDT
- FTP usage in Java by Tony Brookes on August 09 2001 23:04 EDT
-
FTP usage in Java[ Go to top ]
- Posted by: Tim Pouyer
- Posted on: August 01 2001 10:54 EDT
- in response to ravi pal
hi,
There are some ftp classes in the sun packages of the java 2 se. You will have to look in sun.net.ftp package inside the rt.jar file in your jdk1.2 distribution. I have found these classes to be useful but be aware they are sun classes and therefore subject to change without notice or not be included at all in subsequent releases of the jdk. There are no api docs for these classes so you will have to find some other way to figure out how they work ;-)
-
FTP usage in Java[ Go to top ]
- Posted by: Weston Aiken
- Posted on: August 09 2001 07:50 EDT
- in response to ravi pal
A quick and dirty way to use FTP would be to create 2 files on the fly. One that has the ftp commands, and another that executes those commands.
file1.txt
*******************************
open some.ip.address
anonymous
binary
send some.file
*******************************
file2.bat
*******************************
ftp -s:file1.txt
*******************************
Use Runtime.getRunTim().exec(cmd)
cmd would be a String array such as...
String[] cmd = new String[3];
cmd[0] = "command.com" ;
cmd[1] = "/c" ;
cmd[2] = "file2.bat";
-
FTP usage in Java[ Go to top ]
- Posted by: Tony Brookes
- Posted on: August 09 2001 23:04 EDT
- in response to ravi pal
Look for the oroinc network classes, they are the best FTP (and many other protocols) classes I have seen for Java.
Also, check out alphaworks.ibm.com and look for their FTP bean, which is also very good.
Chz
Tony