Barbary Watch Service for OSX

An implementation of Java 7’s WatchService for Java 6 on Mac OS X

Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.incongru.watchservice
Идентификатор

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

barbary-watchservice
Последняя версия

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

1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Barbary Watch Service for OSX
An implementation of Java 7’s WatchService for Java 6 on Mac OS X
Ссылка на сайт

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

https://github.com/gjoseph/BarbaryWatchService
Система контроля версий

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

https://github.com/gjoseph/BarbaryWatchService

Скачать barbary-watchservice

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

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

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
net.java.dev.jna : jna jar 3.2.2

test (1)

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

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

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

BarbaryWatchService

This is the official BarbaryWatchService repository, moved from https://code.google.com/p/barbarywatchservice/

See issues for current plans.

Build Status

An implementation of Java 7’s WatchService for Java 6 on Mac OS X

Java 7 has an API to detect file system changes called Watch Service. This project uses JNA to hook into Apple’s File System Events API.

This is almost a direct drop-in replacement for Java 7’s Watch Service API. I’ve used the API source code from OpenJDK 7 as much as possible.

There’s a Demo example here.

A lot of source code is from OpenJDK.

Differences from Java 7’s API

You obtain a Watch Service instance as follows:

WatchService watcher = WatchService.newWatchService();

Instead of creating Path objects, use WatchableFile objects:

WatchableFile file1 = new WatchableFile(new File("/path/to/watch"));

There is a tutorial for Java 7’s Watch Service API here.

Download

Get the Maven dependency:

  <dependency>
    <groupId>net.incongru.watchservice</groupId>
    <artifactId>barbary-watchservice</artifactId>
    <version>1.0</version>
  </dependency>

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

Версия
1.0