Question: Using the String-processing capabilities, the file and directory capabilities and a Map, create an application that recursively walks a directory structure supplied by the user
Using the String-processing capabilities, the file and directory capabilities and a Map, create an application that recursively walks a directory structure supplied by the user and reports the number of files of each file type (such as .java, .txt, .class, .docx, etc.) that exist in the specified directory path. Display the filename extensions in sorted order. Next, investigate method walk of class the Files. This method returns a stream that walks a directory and its subdirectories and returns the contents to you as a stream. Then, reimplement the first part of this exercise, using lambdas and streams, rather than recursion.
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
This is a twopart question 1 Creating a recursive function that reads a directory structure and reports the number of files of each type 2 Reimplement... View full answer
Get step-by-step solutions from verified subject matter experts
