Refresh FileExplorer when directory changes occur


I have implemented an FileExplorer in Vaadin and I would like to refresh the DataProvider when some changes occur in the main directory.

I have tested the WatchService from Java8 but when I implement this in Vaadin, it will block my whole application.

Hopefully someone can help me with this. Thanks for any advice!

You may already be aware of the [refreshAll]
( method for DataProvider, so it sounds like your real problem is the blocking WatchService.

Without knowing much about your implementation, I can only advise you make sure to execute any asynchronous blocking actions in separate threads and then push any changes to your UI via [ui.access]