The goal of this lab is to practice using recursion to interact with recursively structured data. One example of a recursively structured collection is the file system of a computer. A file system is made up of directories, each of which may contain additional directories.
The following files are provided:
DirectorySearcher.java
This
(unfinished) class is responsible for recursively traversing a
directory tree starting from a designated directory.
DirectoryDriver.java
This is a driver class for executing the methods provided
by DirectorySearcher
. As it is currently written it uses
a DirectorySearcher
to list the contents of the current
directory. listDirectories
method of the
DirectorySearcher
class. Test your finished method by
modifying the driver so that it calls this method instead
of listDirectory
.
searchDirectories
method and create a new driver
class to test it. Your driver class should read a string from the
command line, and recursively search for file names containing that
string in the current directory.
Submit three files through Canvas: completed versions
of DirectorySearcher.java
and DirectoryDriver.java
as well as your new driver
class.