Implementing a customized Hot folder tracking with Java 1.5

One of the features required for the new project is to track changes made on specific folders.

This is the commonly called "hot folder". In the newer java versions this feature already comes implemented using the OS API whenever available.

On my case, being stuck with Java 1.5 there is not other built-in option other than pooling a folder and check for changes.

However, just checking one folder and not going deeper is still kind of limited so we need to stretch this concept further and use the imagination to check other folders without draining away all of the memory available for the java application nor hogging the CPU resources.

This was a nice challenge, used some of the learnings from the Models of Software Systems class with Pedro Bizarro, guess he'd be proud to see a finite state machine diagram being used to describe this concept. It was indeed a good tool to work out the details before moving to the implementation.

I include a small screenshot of the sketch, some changes were made on the final implementation. It's working really fast and indexing all sub-folders at blazing speed with resort to a database to save the precious RAM memory.




Let's move onto the next challenge! :)