Are you familiar with the Java API documentation? If you want to know if a file is being written, you can watch for a change in the file size. I'm not aware of any way to tell if a file is being read. It is possible to do file locking with Java. Depending on your requirements, that may be an option.