Example usage for java.nio.file StandardWatchEventKinds ENTRY_DELETE

List of usage examples for java.nio.file StandardWatchEventKinds ENTRY_DELETE

Introduction

In this page you can find the example usage for java.nio.file StandardWatchEventKinds ENTRY_DELETE.

Prototype

WatchEvent.Kind ENTRY_DELETE

To view the source code for java.nio.file StandardWatchEventKinds ENTRY_DELETE.

Click Source Link

Document

Directory entry deleted.

Usage

From source file:org.siphon.db2js.jshttp.ServerUnitManager.java

public void onFileChanged(WatchEvent<Path> ev, Path file) {
    Kind<Path> kind = ev.kind();
    String filename = file.toString();
    if (kind == StandardWatchEventKinds.ENTRY_DELETE) {
        if (contexts.containsKey(filename)) {
            if (logger.isDebugEnabled()) {
                logger.debug(filename + " dropped");
            }//  w  w  w .ja  v a 2  s.c  om
            contexts.remove(filename);
        }
    } else if (kind == StandardWatchEventKinds.ENTRY_MODIFY) {
        if (contexts.containsKey(filename)) {
            if (logger.isDebugEnabled()) {
                logger.debug(filename + " changed");
            }
            contexts.remove(filename);
        }
    }
}