File class theoretical question
I've been learning java for few days, and I've created a simple code using File class, which returns array of files in specified directory. So I have a question: is there any easy way to return array of ALL files in whole directory, here's an example:
in path c:/ProgramFiles/ there are:
1) dir1 (which has)
..1) dir1.1
..2) dir2.2
....1)dir2.2.1
2) dir2
3) dir3
and so on.
So is there any solution how to return all the files/directories (including subfiles and subdirectories)? I would appreciate any hints :)
Re: File class theoretical question
Recursively traverse through the directory...in pseudocode:
Code :
1. for each file:
if directory:
list files -> go to 1.
else:
add to list