Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Oct 26, 2024
1 parent 97ed80a commit 3a8ff2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/ois/core/utils/io/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.*;
import java.util.stream.Collectors;

public class FileUtils {
public static boolean copyFile(InputStream src, Path target, boolean failIfCantCreate) throws IOException {
Expand Down Expand Up @@ -46,7 +47,7 @@ public static void copyDirectoryContent(Path sourcePath, Path targetPath, String
// Copy all files and subdirectories from source to target
EnumSet<FileVisitOption> options = EnumSet.of(FileVisitOption.FOLLOW_LINKS);
Files.walkFileTree(sourcePath, options, Integer.MAX_VALUE, new SimpleFileVisitor<>() {
private final List<PathMatcher> exclusions = Arrays.stream(excludePatterns).map(pattern -> FileSystems.getDefault().getPathMatcher("glob:" + pattern)).toList();
private final List<PathMatcher> exclusions = Arrays.stream(excludePatterns).map(pattern -> FileSystems.getDefault().getPathMatcher("glob:" + pattern)).collect(Collectors.toList());
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
for (PathMatcher matcher : this.exclusions) {
Expand Down

0 comments on commit 3a8ff2e

Please sign in to comment.