src/com/gynt/jdirwatch/windows/WatchDir.java
private void register(Path dir) throws IOException {
		@SuppressWarnings("restriction")
		ExtendedWatchEventModifier a = com.sun.nio.file.ExtendedWatchEventModifier.FILE_TREE; // Windows
																								// only

		WatchKey key = dir.register(watcher, new WatchEvent.Kind[] { StandardWatchEventKinds.ENTRY_CREATE,
				StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY }, a);
		if (trace) {
			Path prev = keys.get(key);
			if (prev == null) {
				System.out.format("register: %s\n", dir);
			} else {
				if (!dir.equals(prev)) {
					System.out.format("update: %s -> %s\n", prev, dir);
				}
			}
		}
		keys.put(key, dir);
	}
/**
	 * Register the given directory with the WatchService
	 */
Register the given directory with the WatchService
Register the given directory with the WatchService
private void register(Path dir) throws IOException {
		@SuppressWarnings("restriction")
		ExtendedWatchEventModifier a = com.sun.nio.file.ExtendedWatchEventModifier.FILE_TREE; 
		WatchKey key = dir.register(watcher, new WatchEvent.Kind[] { StandardWatchEventKinds.ENTRY_CREATE,
				StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY }, a);
		if (trace) {
			Path prev = keys.get(key);
			if (prev == null) {
				System.out.format("register: %s\n", dir);
			} else {
				if (!dir.equals(prev)) {
					System.out.format("update: %s -> %s\n", prev, dir);
				}
			}
		}
		keys.put(key, dir);
	}
private void register ( Path dir ) throws IOException { @ SuppressWarnings ( "restriction" ) ExtendedWatchEventModifier a = com . sun . nio . file . ExtendedWatchEventModifier . FILE_TREE ; WatchKey key = dir . register ( watcher , new WatchEvent . Kind [ ] { StandardWatchEventKinds . ENTRY_CREATE , StandardWatchEventKinds . ENTRY_DELETE , StandardWatchEventKinds . ENTRY_MODIFY } , a ) ; if ( trace ) { Path prev = keys . get ( key ) ; if ( prev == null ) { System . out . format ( "register: %s\n" , dir ) ; } else { if ( ! dir . equals ( prev ) ) { System . out . format ( "update: %s -> %s\n" , prev , dir ) ; } } } keys . put ( key , dir ) ; }
Register the given directory with the WatchService
Register the given directory with the WatchService
// Windows
 // only
