Have you ever noticed, when you open a file into two different editors, and when you made changes in one, the other one informs you that the file has changed and you need to reload? How does it do that?
Well, the following coding snippet would do the trick. Let’s watch a particular directory and listen to the event.
for copy/paste pleasure: https://github.com/rokon12/100DaysOfJava/blob/main/src/main/java/com/bazlur/Day006.java
Top comments (1)
Warning : it could not work inside a container...
blog.arkey.fr/2019/09/13/watchserv...