trz update - nio.2 MacFileSystemProvider added kqueue WatchService

Michael Hall mik3hall at
Sun Jul 29 18:05:38 PDT 2012

I have added an implementation of a kqueue based WatchService implementation to my OS X specific nio.2 code.

At this time this code will run a slightly modified version of the openjdk WatchService Basic test code. (See known_issues.txt for more info). 

This provides a platform specific non-polling native solution to replace the generic polling WatchService currently being provided in Java 7 for OS X.

I intend to provide one more WatchService based on FSEvents for OS X. See [1[ for mention of kqueue vs. fsevents use.

Example usage to run the modified WatchService Basic test with the kqueue WatchService
java -Djava.nio.file.spi.DefaultFileSystemProvider=us.hall.trz.osx.MacFileSystemProvider -cp lib/macnio2.jar Basic

This adds a WatchService to the currently supported Mac nio.2 file attributes.
Included there are attributes for…
o Finder
o Launch Services
o Cocoa NSFileManager 
o xattr

These provide access to platform specific file meta information not available otherwise with java.

Download - 


More information about the nio-dev mailing list