From 89c71556bd27f09705c82c21f77bc60ea1f3d9e4 Mon Sep 17 00:00:00 2001 From: git4396 <1019859138@qq.com> Date: Thu, 26 Sep 2024 11:38:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E8=BD=AF=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E7=9A=84=E5=88=A4=E6=96=AD=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?oom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: git4396 <1019859138@qq.com> --- src/main/java/ohos/oat/file/OatDirectoryWalker.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/ohos/oat/file/OatDirectoryWalker.java b/src/main/java/ohos/oat/file/OatDirectoryWalker.java index 92a68b7..4a66bc8 100644 --- a/src/main/java/ohos/oat/file/OatDirectoryWalker.java +++ b/src/main/java/ohos/oat/file/OatDirectoryWalker.java @@ -41,6 +41,8 @@ import org.apache.rat.walker.Walker; import java.io.File; import java.io.FilenameFilter; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; @@ -273,7 +275,8 @@ public class OatDirectoryWalker extends Walker { final IOatDocument document = new OatFileDocument(file); document.setOatProject(this.oatProject); if (this.notFilteredPath(document) && this.notFilteredFile(document) && file.isDirectory()) { - if (!this.isRestricted(file)) { + boolean symbolicLink = Files.isSymbolicLink(Paths.get(file.getAbsolutePath())); + if (!this.isRestricted(file) && !symbolicLink) { this.process(document); } } -- Gitee