protected void initNewThread(Path monitoredFile, CountDownLatch start, CountDownLatch stop) throws IOException {
        final Runnable watcher = initializeWatcherWithDirectory(monitoredFile, start, stop);
        final Thread thread = new Thread(watcher);
        thread.setDaemon(false);
        thread.start();
    }
protected void initNewThread ( Path monitoredFile , CountDownLatch start , CountDownLatch stop ) throws IOException { final Runnable watcher = initializeWatcherWithDirectory ( monitoredFile , start , stop ) ; final Thread thread = new Thread ( watcher ) ; thread . setDaemon ( false ) ; thread . start ( ) ; }
Added countdown latches as a synchronization aid to allow better unit testing
Allows one or more threads to wait until a set of operations being performed in other threads completes,
@param monitoredFile
@param start calling start.await() waits till file listner is active and ready
@param stop calling stop.await() allows calling code to wait until a fileChangedEvent is processed
@throws IOException