I need to write a program to read folder path from stdin and all it’s subfolders and then print out the number of files according to their extension.
it will be compiled as follows:
java Summary -r <path>
the output needs to look like:
txt:
number of files: 5
combined size: 1202131
largest file: 729224
smallest file: 12323
pdf:
number of files: 2
etc...
can someone please help me with this? I’m not sure how to approach it.
you can start with something like this for reading files recursively
This code is by @rich.
The rest of the details is something that you have to work out.
You can see Read all files in a folder for more details