apache FTPClient如何删除文件夹

jack_liu4Ye 2011-08-23 02:20:46
使用apache FTPClient如何删除文件夹呢
...全文
882 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jack_liu4Ye 2011-08-23
  • 打赏
  • 举报
回复
找到了是removeDirectory(),谢谢大家!
jack_liu4Ye 2011-08-23
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 java2000_net 的回复:]

sun自带的有如下的功能,我认为你的apache的也有类似的方法:

deleteDirectory

void deleteDirectory(RemoteFile dir)
throws FTPException,
ConnectionException

Deletes……
[/Quote]

我仔细查看了apache FTPClient类中的方法,只有deleteFile()这个方法。

还有一个dele()方法。

还有sun自带的deleteDirectory我也没找到,但是有人这么用
ftpClient.sendServer("MKD " + ftpDirectory + "\r\n");
liuyuhua0066 2011-08-23
  • 打赏
  • 举报
回复
和File的delete操作相似

[Quote=引用 2 楼 java2000_net 的回复:]
sun自带的有如下的功能,我认为你的apache的也有类似的方法:

deleteDirectory

void deleteDirectory(RemoteFile dir)
throws FTPException,
ConnectionException

Deletes the specified directory dir on the remote syste……
[/Quote]
老紫竹 2011-08-23
  • 打赏
  • 举报
回复
sun自带的有如下的功能,我认为你的apache的也有类似的方法:

deleteDirectory

void deleteDirectory(RemoteFile dir)
throws FTPException,
ConnectionException

Deletes the specified directory dir on the remote system. Most FTP servers would not allow the deletion of a directory unless it is empty. It is the responsibility of the clients to delete the children of the directory before attempting to delete a directory.

Parameters:
dir - Directory to delete.
Throws:
FTPException
ConnectionException

jack_liu4Ye 2011-08-23
  • 打赏
  • 举报
回复
使用apache FTPClient如何删除ftp下的文件夹呢??

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧