Package com.darylteo.nio

Examples of com.darylteo.nio.DirectoryWatcher


    DirectoryWatchService service = extension.getService();
    ProjectConnection connection = extension.getConnection();

    // setup watcher
    DirectoryWatcher watcher = service.newWatcher(getProject().getProjectDir().getPath());

    for (Object o : this.includes) {
      watcher.include(o.toString());
    }

    for (Object o : this.excludes) {
      watcher.exclude(o.toString());
    }

    // setup builder
    // Note: BuildLauncher only accepts the Task from .model package.
    String[] tasks = generateTaskArguments(project, this.tasks);
    this.builder = connection.newBuild().forTasks(tasks);

    watcher.subscribe(new DirectoryChangedSubscriber() {
      @Override
      public void directoryChanged(DirectoryWatcher watcher, Path entry) {
        synchronized (mutex) {
          WatcherTask.this.lastChange = System.currentTimeMillis();
          mutex.notifyAll();
View Full Code Here

TOP

Related Classes of com.darylteo.nio.DirectoryWatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.