• 如何让 j望永远检查事件? 我要说的是,我只想到事情。
for (WatchEvent event : events) {
boolean terminate_or = false;
if (event.kind() == StandardWatchEventKind.ENTRY_CREATE) {
System.out.println("Created: " + event.context().toString());
event.
}
if (event.kind() == StandardWatchEventKind.ENTRY_DELETE) {
System.out.println("Delete: " + event.context().toString());
terminate_or = true;
}
if (event.kind() == StandardWatchEventKind.ENTRY_MODIFY) {
System.out.println("Modify: " + event.context().toString());
terminate_or = true;
}
}
但只有一次,然后终止。