From f36c83421e39a1e46820a37a778b8d8f921270b3 Mon Sep 17 00:00:00 2001 From: Looly Date: Fri, 24 Mar 2023 00:01:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DWatchUtil=20createModify=20ma?= =?UTF-8?q?xDepth=E4=BC=A0=E9=80=92=E5=90=8E=E6=B2=A1=E6=9C=89=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../main/java/cn/hutool/core/io/watch/WatchUtil.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c81ae0b..c0f418fe8 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * 【core 】 修复DateUtil针对ISO8601时间格式部分场景下的解析存在问题(issue#2981@Github) * 【core 】 修复JSONUtil.toBean可能的空指针问题(issue#2987@Github) * 【core 】 修复CalendarUtil.isSameMonth没有判断公元前导致不一致的问题(issue#3011@Github) +* 【core 】 修复WatchUtil createModify maxDepth传递后没有使用问题(issue#3005@Github) ------------------------------------------------------------------------------------------------------------- # 5.8.15 (2023-03-09) diff --git a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java b/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java index bddcf8b0a..b74b8b67b 100644 --- a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchUtil.java @@ -1,14 +1,14 @@ package cn.hutool.core.io.watch; +import cn.hutool.core.io.IORuntimeException; +import cn.hutool.core.util.URLUtil; + import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URL; import java.nio.file.*; -import cn.hutool.core.io.IORuntimeException; -import cn.hutool.core.util.URLUtil; - /** * 监听工具类
* 主要负责文件监听器的快捷创建 @@ -199,7 +199,7 @@ public class WatchUtil { * @return {@link WatchMonitor} */ public static WatchMonitor createAll(File file, int maxDepth, Watcher watcher) { - return createAll(file.toPath(), 0, watcher); + return createAll(file.toPath(), maxDepth, watcher); } /** @@ -323,7 +323,7 @@ public class WatchUtil { * @since 4.5.2 */ public static WatchMonitor createModify(File file, int maxDepth, Watcher watcher) { - return createModify(file.toPath(), 0, watcher); + return createModify(file.toPath(), maxDepth, watcher); } /**