how to delete file from ftp server using java?

后端 未结 4 731
无人及你
无人及你 2021-02-19 04:07

How can I delete a file from an ftp server using a java program? I am successfully able to upload files on the ftp using the following code:

public static void m         


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-02-19 04:48

    Java's URL and URLConnection do not have support for deletion of resources. (I'm even surprised that upload works).

    So you'll either have to use an FTP client library (like FTPClient from Apache Commons Net), or have to implement the necessary parts of the client side of the FTP protocol yourself.

提交回复
热议问题