Java detect changes in filesystem

前端 未结 2 1894
我寻月下人不归
我寻月下人不归 2020-12-06 02:25

I have a folder in which continuously new files are being dumped.In Java,what is the best way to detect changes in file-system (ie. a specified folder in which the files are

2条回答
  •  被撕碎了的回忆
    2020-12-06 03:28

    Continuously polling is the way to do it in Java as of now - though don't poll too often, it can be quite a heavy operation if the directory contains lots of entries.

    JDK 7 will have a specific API for doing just this java.nio.file.WatchFile

提交回复
热议问题