So I realize that this is not truly a
java problem/question but I imagine that someone here has run into this before.
If I have the following directory structure"
Docs
|
---> Work
---> Home
If I add/remove a file/directory from the Work directory its last updated date changes, but the last updated data for Docs does not change.
The case I have the directory structure is much bigger, but same problem. I have a top level directory like 'Docs' and I need to know if any files/directories have been added/removed in any part of that directory tree.
I have thought of one possible solution and was wondering what others think or of anyone has had success with another solution.
I was going to recursively parse the entire tree starting at 'Docs' and store every file/directory in a list. Then iterate the list adding up all the last modified dates. (probably subtract off the smallest last modified form each so that the number does not get too big). If the sum of all last modified dates is different than a previous calculation then a directory/file has been changed.
As you can probably tell from this solution I do not need to know which directory/file changed, just that one or more have changed.
Thanks in advance.