Package | Description |
---|---|
org.dromara.hutool.core.io.watch |
基于JDK7+ WatchService的文件和目录监听封装,支持多级目录
|
Modifier and Type | Method and Description |
---|---|
static WatchServiceWrapper |
WatchServiceWrapper.of(WatchEvent.Kind<?>... events)
创建WatchServiceWrapper
|
WatchServiceWrapper |
WatchServiceWrapper.registerPath(Path path,
int maxDepth)
递归将指定路径加入到监听中
如果提供的是目录,则监听目录本身和目录下的目录和文件,深度取决于maxDepth |
WatchServiceWrapper |
WatchServiceWrapper.setEvents(WatchEvent.Kind<?>... events)
监听事件列表,见:StandardWatchEventKinds
|
WatchServiceWrapper |
WatchServiceWrapper.setEvents(WatchKind... kinds)
监听事件列表,见:StandardWatchEventKinds
|
WatchServiceWrapper |
WatchServiceWrapper.setModifiers(WatchEvent.Modifier... modifiers)
设置监听选项,例如监听频率等,可设置项包括:
1、com.sun.nio.file.StandardWatchEventKinds
2、com.sun.nio.file.SensitivityWatchEventModifier
|
Copyright © 2025. All rights reserved.