diff --git a/hutool-core/src/main/java/cn/hutool/core/io/file/PathUtil.java b/hutool-core/src/main/java/cn/hutool/core/io/file/PathUtil.java index 4b5edf039..af1e878e4 100644 --- a/hutool-core/src/main/java/cn/hutool/core/io/file/PathUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/io/file/PathUtil.java @@ -406,7 +406,7 @@ public class PathUtil { * @return byte数组 * @since 5.5.4 */ - public static byte[] readBytes(Path path){ + public static byte[] readBytes(Path path) { try { return Files.readAllBytes(path); } catch (IOException e) { @@ -562,7 +562,7 @@ public class PathUtil { * @return 转换后的Path * @since 5.5.5 */ - public static Path toAbsNormal(Path path){ + public static Path toAbsNormal(Path path) { Assert.notNull(path); return path.toAbsolutePath().normalize(); } @@ -572,8 +572,8 @@ public class PathUtil { * * @param file 文件 * @return MimeType - * @since 5.5.5 * @see Files#probeContentType(Path) + * @since 5.5.5 */ public static String getMimeType(Path file) { try { @@ -616,15 +616,15 @@ public class PathUtil { * 删除文件,不追踪软链 * * @param path 文件对象 - * @throws IORuntimeException IO异常 + * @throws IOException IO异常 * @since 5.7.7 */ protected static void delFile(Path path) throws IOException { try { Files.delete(path); - }catch (AccessDeniedException e) { + } catch (AccessDeniedException e) { // 可能遇到只读文件,无法删除.使用 file 方法删除 - if(false == path.toFile().delete()) { + if (false == path.toFile().delete()) { throw e; } } diff --git a/hutool-core/src/main/java/cn/hutool/core/io/file/visitor/MoveVisitor.java b/hutool-core/src/main/java/cn/hutool/core/io/file/visitor/MoveVisitor.java index 15f2efb88..030a319ee 100755 --- a/hutool-core/src/main/java/cn/hutool/core/io/file/visitor/MoveVisitor.java +++ b/hutool-core/src/main/java/cn/hutool/core/io/file/visitor/MoveVisitor.java @@ -30,6 +30,7 @@ public class MoveVisitor extends SimpleFileVisitor { * * @param source 源Path * @param target 目标Path + * @param copyOptions 拷贝(移动)选项 */ public MoveVisitor(Path source, Path target, CopyOption... copyOptions) { if(PathUtil.exists(target, false) && false == PathUtil.isDirectory(target)){ diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/reflect/MethodHandleUtil.java b/hutool-core/src/main/java/cn/hutool/core/lang/reflect/MethodHandleUtil.java index 224e3cfe8..781208744 100755 --- a/hutool-core/src/main/java/cn/hutool/core/lang/reflect/MethodHandleUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/reflect/MethodHandleUtil.java @@ -128,7 +128,7 @@ public class MethodHandleUtil { * MethodHandleUtil::invokeDefault); * * - * @param 返回结果类型 + * @param 返回结果类型 * @param obj 接口的子对象或代理对象 * @param methodName 方法名称 * @param args 参数 @@ -148,7 +148,7 @@ public class MethodHandleUtil { /** * 执行接口或对象中的方法 * - * @param 返回结果类型 + * @param 返回结果类型 * @param obj 接口的子对象或代理对象 * @param method 方法 * @param args 参数 @@ -174,7 +174,7 @@ public class MethodHandleUtil { * MethodHandleUtil::invoke); * * - * @param 返回结果类型 + * @param 返回结果类型 * @param obj 接口的子对象或代理对象 * @param method 方法 * @param args 参数 @@ -200,10 +200,11 @@ public class MethodHandleUtil { * MethodHandleUtil::invoke); * * - * @param 返回结果类型 - * @param obj 接口的子对象或代理对象 - * @param method 方法 - * @param args 参数 + * @param 返回结果类型 + * @param isSpecial 是否为特殊方法(private、static等) + * @param obj 接口的子对象或代理对象 + * @param method 方法 + * @param args 参数 * @return 结果 */ @SuppressWarnings("unchecked") @@ -214,7 +215,7 @@ public class MethodHandleUtil { try { MethodHandle handle = isSpecial ? lookup.unreflectSpecial(method, declaringClass) : lookup.unreflect(method); - if(null != obj){ + if (null != obj) { handle = handle.bindTo(obj); } return (T) handle.invokeWithArguments(args);