递归搜索Java中的目录 [英] Recursively search for a directory in Java

查看:19
本文介绍了递归搜索Java中的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Java 中查找具有特定名称的目录的最佳方法是什么?我要查找的目录可以位于当前目录或其子目录之一中.

What is the best way to find a directory with a specific name in Java? The directory that I am looking for can be located either in the current directory or one of its subdirectories.

推荐答案

您的解决方案将包括使用 File.listFiles(String)

Your solution will include the use of File.listFiles(String)

java.io.File API参考

这篇关于递归搜索Java中的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆