Java 7 Watch Service ENTRY_CREATE triggered before file is written

后端 未结 2 1573
失恋的感觉
失恋的感觉 2020-12-16 22:09

I have a watch service watching a directory. Once files are created, I\'m processing the directory and updating a tree view.

This works fine on ENTRY_DELETE

2条回答
  •  Happy的楠姐
    2020-12-16 22:53

    I had the same issue, I added few seconds delay once the event is created before processing. Since Other application used to write the file and it used to take couple of seconds to flush the content and release the file.

提交回复
热议问题