Java 7 introduced WatchService for monitoring file systems continuously. Is there a backport for Java 6 ?
Are there pure Java libraries with similar features ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yes, of course. Apache VFS does exactly this. you can find it under http://commons.apache.org/vfs/. It’s a pure java library that can monitor files and it’s pretty easy to use:
the code above will monitor the file c:/MyFile.txt. if it changes, the object new MyListener() is called.