Windows 7 /Eclipse watchpoint on file access

211 Views Asked by At

Is there a way in Eclipse [Helios] on Win 7 to watch for a file to be opened? Do I have to know where the app is going to do so, or is there a way to watch for a java.io object being created/something or other?

tia Rene

1

There are 1 best solutions below

0
On

You could try setting breakpoints on the constructors of FileInputStream and/or FileOutputStream with conditions to check whether the filename provided matches your target filename (e.g. check the parameter on the constructors that take a filename, check the File.getName() on the constructors that take a File). Alternatively or in addition, you could set breakpoints on File constructors with a condition to check whether the specified filename is your target filename.

If your breakpoint trap trips, you can follow the stacktrace to see what methods are directly or indirectly access the file.