Lines Matching defs:dir
44 static void checkKey(WatchKey key, Path dir) {
47 if (key.watchable() != dir)
80 static void testEvents(Path dir) throws IOException {
90 System.out.format("register %s for ENTRY_CREATE\n", dir);
91 WatchKey myKey = dir.register(watcher,
93 checkKey(myKey, dir);
96 Path file = dir.resolve("foo");
113 System.out.format("register %s for ENTRY_DELETE\n", dir);
114 WatchKey deleteKey = dir.register(watcher,
118 checkKey(deleteKey, dir);
137 System.out.format("register %s for ENTRY_MODIFY\n", dir);
138 WatchKey newKey = dir.register(watcher,
142 checkKey(newKey, dir);
163 static void testCancel(Path dir) throws IOException {
168 System.out.format("register %s for events\n", dir);
169 WatchKey myKey = dir.register(watcher,
171 checkKey(myKey, dir);
177 Path file = dir.resolve("mars");
202 static void testAutomaticCancel(Path dir) throws IOException {
205 Path subdir = Files.createDirectory(dir.resolve("bar"));
231 static void testWakeup(Path dir) throws IOException {
268 static void testExceptions(Path dir) throws IOException {
298 dir.register(watcher, new WatchEvent.Kind<?>[]{ } );
304 dir.register(watcher, new WatchEvent.Kind<?>[]{ OVERFLOW });
311 dir.register(watcher, new WatchEvent.Kind<?>[]{
319 dir.register(watcher,
331 dir.register(null, new WatchEvent.Kind<?>[]{ ENTRY_CREATE });
336 dir.register(watcher, new WatchEvent.Kind<?>[]{ null });
341 dir.register(watcher, new WatchEvent.Kind<?>[]{ ENTRY_CREATE },
382 dir.register(watcher, new WatchEvent.Kind<?>[]{ ENTRY_CREATE });
394 static void testTwoWatchers(Path dir) throws IOException {
405 Path file1 = dir.resolve(name1);
411 WatchKey key1 = dir.register(watcher1,
413 WatchKey key2 = dir.register(watcher2,
420 Path file2 = dir.resolve(name2);
454 key2 = dir.register(watcher2, new WatchEvent.Kind<?>[]{ ENTRY_CREATE });
472 Path dir = TestUtil.createTemporaryDirectory();
475 testEvents(dir);
476 testCancel(dir);
477 testAutomaticCancel(dir);
478 testWakeup(dir);
479 testExceptions(dir);
480 testTwoWatchers(dir);
483 TestUtil.removeAll(dir);