且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用java从ftp服务器中删除文件?

更新时间:2023-12-04 21:03:04

您可以使用 Apache FTPClient 来在FTP上执行此操作和所有其他命令。
使用如下所示:

You can use Apache FTPClient to do this and all other commands on FTP. Use it something like this:

...
FTPClient client = new FTPClient();
client.connect(host, port);
client.login(loginname, password);
client.deleteFile(fileNameOnServer);
client.disconnect();
...