Deleting romte ftp file using URL and Input/Output Strems

Hi,

I am developing a small java application and I need to perform some ftp operations: get a file from the server, put a file in the server, find out if a file exist in the server and delete a file in the server.

I am implementing this methods using de URL class and treating remote files as InputStream and OutputStreams. I am not able to use the RFC959 implementation in the JDK that supposly exists because I have read it is internal, undocumented and so on. I am also not able to use third party libraries because of organizational policies :(

I have managed to implement the "get", "put", "find out if a file exists" methods so far, but I am having problems with "deleting a file in the server" with this technique.

Does anyone know how to implement the ftp remote file deletion using URL and Input/Output streams?

Maybe there is a better way of getting the job done using the JDK, I would be pleased to receive any piece of advice.

Thanks.

[989 byte] By [mmutilvaa] at [2007-11-26 23:54:44]
# 1
jakarta commons supports full ftp support.There is a thread around some where which provides a link to a Sun employee blog that discusses the very low functionality of the interface you are discussing.I believe it points to a RFE in the bug database which add improvements.
jschella at 2007-7-11 15:37:34 > top of Java-index,Core,Core APIs...
# 2
Thanks a lot!I'll check the jakarta commons.
mmutilvaa at 2007-7-11 15:37:34 > top of Java-index,Core,Core APIs...
# 3
Hello. I have an example on using Commons Net to perform FTP transfers, including how to delete remote files. Its very easy to use. Check out my example code at http://timarcher.com/?q=node/56Tim
timarcher52a at 2007-7-11 15:37:34 > top of Java-index,Core,Core APIs...