javafile-monitoring

Java: Keep track of files that are touched in the OS


For my application I need to keep track of all files that are touched using the OS (Windows or Mac). By touching I'm talking about opening files or saving files. Is this possible at all? And if yes, what keywords should I google?


Solution

  • Apache commons io library, if you want to use with Java 6.*

    extending more: On a second look here is question in SO { Is there a sophisticated file system monitor for Java which is freeware or open source? } It may be the one Roflcoptr is interested. It talks about http://jnotify.sourceforge.net/. I did not use that for getting info on reading, though.