Apache VFS(2):文件的监听和监控
本系列文章导航Apache VFS(1): 基本介绍
Apache VFS(2): 文件的监听和监控
Apache VFS(3): 文件过滤器和选择器
Apache VFS(4): 事件
Apache VFS(5): 使用它!
Apache VFS(6): 几个重要的概念性接口
Apache VFS(7): 文件管理器解析文件的方法
Apache VFS有文件监听和监控功能。
FileListener接口监听三种事件:
[*]fileChanged(FileChangeEvent eve): 文件变化,只有使用了FileMonitor才触发
[*]fileCreated(FileChangeEvent eve): 文件创建
[*]fileDeleted(FileChangeEvent eve): 文件删除
FileChangeEvent很简单,只有一个方法getFile(),返回触发事件的FileObject对象。
文章来源:http://alartin.javaeye.com/blog/92084
页:
[1]