Originally posted by raghav mathur:
Does URLConnection class is only helpful for making http url connections ? . for any other protocol why is not advisable to make use of URLConnection class.
P.S : Sorry for deviating from the original topic.
Thanks in advance
URLConnection is used to make a connection to any URL. It can even be
ftp://server/.../file. But the 'ftp://' protocol only lets you receive the file. As far as I know, you cannot even use 'ftp://' to send a file to the server.
The problem is that the URL protocol 'ftp://' is only a subset of the FTP protocol. To get the full function of FTP, you will have to either find another FTP client for java, or write your own socket driver.
Here's the fun part. To speak FTP, you actually need *two* sockets, one for control and one for data. You send the FTP commands such as DELETE or LIST to the control socket, and receive a response such as "200 OK". You send and receive the files to be uploaded or downloaded to the data socket.
I am certain that there must be a good open source FTP client in 100% Java out there. I don't know where though. Anyone?