private void run_aux() throws ProtboxException, IOException {
        try {
            if (Constants.verbose) {
                logger.info("WatchService for " + root.toString() + " started.");
            }

            while (!Thread.currentThread().isInterrupted()) {
                try {
                    WatchKey key = watchService.take();
                    for (WatchEvent event : key.pollEvents()) {
                        Path relativePath = (Path) event.context();
                        Path path = ((Path) key.watchable()).resolve(relativePath);

                        WatchEvent.Kind kind = event.kind();

                        if (kind.equals(StandardWatchEventKinds.ENTRY_CREATE)) {
                            if (path.toFile().isDirectory()) {
                                watchFolder(path);
                            }
                            onFileCreated(path.toFile());
                        } else if (kind.equals(StandardWatchEventKinds.ENTRY_DELETE)) {
                            onFileDeleted(path.toFile());
                        }
                    }
                    key.reset();
                } catch (ClosedWatchServiceException ex) {
                    break;
                }
            }
        } catch (InterruptedException ex) {
            if (Constants.verbose) {
                logger.info("WatchService for " + root.toString() + " stopped.");
            }
        } finally {
            watchService.close();
        }
    }