Class TreeWatcherNIO

  • All Implemented Interfaces:
    Watcher

    public class TreeWatcherNIO
    extends AbstractNIO2Watcher

    NIO2 watcher implementation for systems which support ExtendedWatchEventModifier.FILE_TREE (windows)

    Java 7 (NIO2) watch a directory (or tree) for changes to files.

    Author:
    alpapad@gmail.com
    • Constructor Detail

      • TreeWatcherNIO

        public TreeWatcherNIO()
                       throws IOException
        Instantiates a new tree watcher nio.
        Throws:
        IOException - Signals that an I/O exception has occurred.
    • Method Detail

      • registerAll

        protected void registerAll​(Path dir)
                            throws IOException
        Register the given directory, with the WatchService. Sub-directories are automatically watched (filesystem supported)
        Specified by:
        registerAll in class AbstractNIO2Watcher
        Parameters:
        dir - the dir
        Throws:
        IOException - Signals that an I/O exception has occurred.