Folder Update Detection
I need your help, i have been researching for a code wherein a java
program can detect any changes that has been made for a specific
folder or directory.
for example a new file is added in the directory the java program will
e-mail me that i have a new folder inside my directory.
can any body help me with this?
A loop that checks the directory every once in a while.
See the API docs for File.
how very specific! haha! im just joking. ill try to search first on the API. although it would be better if you share your ideas.
What is missing there? Keep the array that one of File's methods gives you and compare it to the array that that same method gives you the next time you call it.
so how do i implement it if i want it to run recursively?
A List of Lists and a method that can be called recursively as you traverse directory depth.
You would probably be better off, however, with a list of directory paths and an array per directory (probably a Map<File, File> would be best).