chore(mon_dir): refactored
This commit is contained in:
parent
e95f283e8c
commit
7bfc152906
|
@ -11,8 +11,6 @@ public class Main {
|
||||||
|
|
||||||
private static final String FOLDER = "/opt/npm";
|
private static final String FOLDER = "/opt/npm";
|
||||||
|
|
||||||
private static final String FILE = "/opt/npm/NetPeerManager.log";
|
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException,
|
public static void main(String[] args) throws IOException,
|
||||||
InterruptedException {
|
InterruptedException {
|
||||||
LOG.trace("app started...");
|
LOG.trace("app started...");
|
||||||
|
@ -24,7 +22,6 @@ public class Main {
|
||||||
WatchService watchService = FileSystems.getDefault().newWatchService();
|
WatchService watchService = FileSystems.getDefault().newWatchService();
|
||||||
|
|
||||||
//register a Path instance for events using a WatchService instance
|
//register a Path instance for events using a WatchService instance
|
||||||
//TODO You cannot watch a file this way! java.nio.file.NotDirectoryException
|
|
||||||
folderPath.register(watchService, StandardWatchEventKinds.ENTRY_CREATE,
|
folderPath.register(watchService, StandardWatchEventKinds.ENTRY_CREATE,
|
||||||
StandardWatchEventKinds.ENTRY_MODIFY,
|
StandardWatchEventKinds.ENTRY_MODIFY,
|
||||||
StandardWatchEventKinds.ENTRY_DELETE);
|
StandardWatchEventKinds.ENTRY_DELETE);
|
||||||
|
@ -57,4 +54,4 @@ public class Main {
|
||||||
|
|
||||||
LOG.trace("app done.");
|
LOG.trace("app done.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue