如何轮询目录以检查是否添加新文件? [英] How to poll directory to check whether new file is added?
本文介绍了如何轮询目录以检查是否添加新文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想轮询一个目录来检查是否将新文件添加到目录中。如果有任何新文件被添加,我想读取该文件。
I want to poll a directory to check whether new file is added to the directory. If any new file is added I want to read that file.
有人可以给我一个想法吗?
Can anybody give me an idea how to do that?
推荐答案
- Java 7有一个
- JNotify 也会这样做。
- Java 7 has a file watcher API
- JNotify will do it as well.
这篇关于如何轮询目录以检查是否添加新文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文