Class PrivilegedFileWatcher

All Implemented Interfaces:
ResourceWatcher

public class PrivilegedFileWatcher extends FileWatcher
Extension of FileWatcher that does privileged calls to IO.

This class exists so that the calls into the IO methods get here first in the security stackwalk, enabling us to use doPrivileged to ensure we have access. If we don't do this, the code location that is doing the accessing is not the one that is granted the SecuredFileAccessPermission, so the check in ESPolicy fails.