Recursively search for a directory in Java

后端 未结 7 2131
深忆病人
深忆病人 2021-01-05 10:45

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 subdi

7条回答
  •  天涯浪人
    2021-01-05 10:47

    Divide and conquer? A naive approach: For every directory, you may start a task, it does the following:

    1. list every directory
    2. if the list contains a matching directory, prints and exit the application
    3. start a task for every directory.

提交回复
热议问题