
com.magictools.core.io.watch.Watcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magic-tools-all Show documentation
Show all versions of magic-tools-all Show documentation
magic-tools 是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
The newest version!
package com.magictools.core.io.watch;
import java.nio.file.Path;
import java.nio.file.WatchEvent;
/**
* 观察者(监视器)
*
* @author Looly
*/
public interface Watcher {
/**
* 文件创建时执行的方法
*
* @param event 事件
* @param currentPath 事件发生的当前Path路径
*/
void onCreate(WatchEvent> event, Path currentPath);
/**
* 文件修改时执行的方法
* 文件修改可能触发多次
*
* @param event 事件
* @param currentPath 事件发生的当前Path路径
*/
void onModify(WatchEvent> event, Path currentPath);
/**
* 文件删除时执行的方法
*
* @param event 事件
* @param currentPath 事件发生的当前Path路径
*/
void onDelete(WatchEvent> event, Path currentPath);
/**
* 事件丢失或出错时执行的方法
*
* @param event 事件
* @param currentPath 事件发生的当前Path路径
*/
void onOverflow(WatchEvent> event, Path currentPath);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy