Java Directory Watcher

Watch and receive notifications on filesystem changes using Java 7 NIO's WatchService

Лицензия

Лицензия

Группа

Группа

com.darylteo
Идентификатор

Идентификатор

directorywatcher
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Java Directory Watcher
Watch and receive notifications on filesystem changes using Java 7 NIO's WatchService
Ссылка на сайт

Ссылка на сайт

http://github.com/darylteo/directorywatcher
Система контроля версий

Система контроля версий

http://github.com/darylteo/directorywatcher

Скачать directorywatcher

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.darylteo/directorywatcher/ -->
<dependency>
    <groupId>com.darylteo</groupId>
    <artifactId>directorywatcher</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.darylteo/directorywatcher/
implementation 'com.darylteo:directorywatcher:1.1.0'
// https://jarcasting.com/artifacts/com.darylteo/directorywatcher/
implementation ("com.darylteo:directorywatcher:1.1.0")
'com.darylteo:directorywatcher:jar:1.1.0'
<dependency org="com.darylteo" name="directorywatcher" rev="1.1.0">
  <artifact name="directorywatcher" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.darylteo', module='directorywatcher', version='1.1.0')
)
libraryDependencies += "com.darylteo" % "directorywatcher" % "1.1.0"
[com.darylteo/directorywatcher "1.1.0"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.+

Модули Проекта

Данный проект не имеет модулей.

Directory Watcher for Java 7

Watches for changes in files and folders recursively. Features Ant style filtering patterns.

Distribution

Maven

<dependency>
  <groupId>com.darylteo</groupId>
  <artifactId>directory-watcher</artifactId>
  <version>1.2.0</version>
</dependency>

Gradle

dependencies {
  compile 'com.darylteo~directory-watcher~1.2.0'
}

Example

public class Example {
  public static void main(String[] args) {
    // Get Watcher
    ThreadPoolDirectoryWatchService factory = new ThreadPoolDirectoryWatchService(); // or PollingDirectoryWatchService
    DirectoryWatcher watcher = factory.newWatcher("");
    
    // Configure 
    watcher.include("src/**");
    watcher.exclude("bin");
    watcher.exclude("build");
    watcher.exclude("bin/**");
    watcher.exclude("build/**");
    
    // Subscribe
    watcher.subscribe(new DirectoryChangedSubscriber() {
      public void directoryChanged(DirectoryWatcher watcher, Path path) {
        System.out.println("Something changed! " + path.toString());
      }
    });
    
    // Cleanup
    factory.close();
  }
}

Documentation

Javadoc

Версии библиотеки

Версия
1.1.0
1.0.1
1.0.0