Skip to content

Commit

Permalink
updating the FileWatcher class
Browse files Browse the repository at this point in the history
  • Loading branch information
laminba2003 committed Nov 28, 2019
1 parent 6299853 commit d3bbbdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/gservlet/FileWatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public void run() {
WatchService watcher = FileSystems.getDefault().newWatchService();
Path path = Paths.get(folder.getAbsolutePath());
path.register(watcher, ENTRY_CREATE, ENTRY_DELETE);
boolean valid = true;
while (valid) {
valid = pollEvents(watcher);
boolean poll = true;
while (poll) {
poll = pollEvents(watcher);
}
} catch (IOException e) {
logger.log(Level.INFO, "exception during watch", e);
Expand Down

0 comments on commit d3bbbdf

Please sign in to comment.