Skip to content

Commit

Permalink
fix: follow links on walkFileTree
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Jan 6, 2023
1 parent a8e29b7 commit b294230
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.FileVisitOption;
import java.nio.file.FileVisitResult;
import java.nio.file.FileVisitor;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import lombok.Getter;
Expand Down Expand Up @@ -65,7 +68,8 @@ public String[] getSelectedFiles() {
final List<PathMatcher> excludedPatterns = buildPathMatchers(excluded);

final List<String> results = new ArrayList<>();
Files.walkFileTree(basePath, new FileVisitor<>() {
final Set<FileVisitOption> followLinksOption = EnumSet.of(FileVisitOption.FOLLOW_LINKS);
Files.walkFileTree(basePath, followLinksOption, Integer.MAX_VALUE, new FileVisitor<>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
final Path path = basePath.relativize(dir);
Expand Down

0 comments on commit b294230

Please sign in to comment.