Question: Create a Java program that analyzes a folder of input files and produces the output into multiple other files. The program must retrieve the paths

Create a Java program that analyzes a folder of input files and produces the output into multiple other files. The program must retrieve the paths to every .java and .txt file in the hierarchy. Once all the paths to the files are found the program must figure out the length of the longest line. For example, working with an input file called MainFile.java. Once it figures out the longest line it will put the output into MainFile.java.stats and it will be located in the same directory. This program will also be able to able to analyze all the other files in the folder, not just MainFile.java. So, if Data.java is also in the folder the longest line length will be outputted in Data.java.stats. It doesn't matter what the contents of the .java file is as long as the output is correct in the .java.stats file. You can use your own .java files and folders to figure this program out. You must use List lines = Files.readAllLines(filePath, Charset.defaultCharset()); to find all the files in a folder. And you must use void writeToFile( Path location, List toWrite ){ Files.write(location,toWrite,Charset.defaultCharset()); } to create the output text. Please use both of the bolded code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!