上一篇讲到了如何删除服务器的目录,大家可能都发现了,通过上面的命令只能删除服务器上的一个空目录,其源码的注释已经给了说明:
/**
* Remove an empty directory.
*
* @param dirName See the {@link SFTPv3Client comment} for the class for more details.
* @throws IOException
*/
public void rmdir(String dirName) throws IOException
{
int req_id = generateNextRequestID();
TypesWriter tw = new TypesWriter();
tw.writeString(dirName, charsetName);
sendMessage(Packet.SSH_FXP_RMDIR, req_id, tw.getBytes());
expectStatusOKMessage(req_id);
}
Remove an empty directory.
如果删掉的目录下面存在目录和文件,那么我们
改如何处理啦,下面的一篇我们将处理这个问题。