java ftp 创建文件夹,在Java中通过FTP创建文件夹层次结构

博客讨论了如何在Java中利用Apache Commons FTPClient库创建远程FTP服务器的目录层级。虽然该库提供了创建单个目录的功能,但不直接支持创建整个路径。解决方案是通过递归方式遍历目录树并在每个层级上创建所需目录。
摘要由CSDN通过智能技术生成

Is there readily available functionality for Java to create a folder hierarchy on a remote FTP server. Apache Commons does provide an FTP client, but I can't find a method for creating a directory hierarchy.

It does allow for creating a single directory (makeDirectory), but creating an entire path does not seem to be in there.

The reason I want this is because sometimes part of a directory hierarchy is not (yet) available and in such a case I want to create the missing part of the hierarchy and then change to that newly created directory.

解决方案

You have to use a combination of false.

You need to recursively walk the directory tree in the manner described above at each level create the directory as required.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值