Currently i am trying to connect to a site using ftp using the below method to upload a file
Now my question is how from java can i create or delete a directory as well as create or delete a file using ftp?
URL url = new URL("ftp://user01:firstname.lastname@example.org/README.txt;type=i");
URLConnection urlc = url.openConnection();
OutputStream os = urlc.getOutputStream(); // To upload
Is there also a way i can just connect to a ftp site say ftp.foo.com without specifying the file name so that i can connect to the ftp site first, create a file first then go to that file?
Any help is greatly appreciated
Currently I'm using Jakarta Commons Net library, which includes FTP package . It supports quite full functions to write a FTP program, even create, delete file or dir...better than Sun's implementation. You should check out here :
http://jakarta.apache.org/commons/net/ --> for download
You'll need to write protocol for handling FTP and understand the commands the protocol uses. I *think* its similar to using a Telnet protocol, but I'm not positive. You're probably much better off using a 3rd party package.
If you really want to write your own protocol handler, read through this:
By lwinn213 in forum Java
Last Post: 10-23-2008, 02:14 PM
By chrispl in forum VB Classic
Last Post: 06-25-2006, 08:39 AM
Last Post: 03-21-2006, 11:35 PM
By William Kochevar in forum Web
Last Post: 10-18-2001, 02:05 PM
By Julian Milano in forum VB Classic
Last Post: 08-11-2000, 01:11 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center