|
35 | 35 | import com.scanoss.utils.JsonUtils; |
36 | 36 | import lombok.*; |
37 | 37 | import lombok.extern.slf4j.Slf4j; |
| 38 | +import org.jetbrains.annotations.NotNull; |
38 | 39 |
|
39 | 40 | import java.io.File; |
40 | 41 | import java.io.IOException; |
@@ -223,17 +224,19 @@ public List<String> processFolder(@NonNull String folder, FileProcessor processo |
223 | 224 | List<Future<String>> futures = new ArrayList<>(); |
224 | 225 | try { |
225 | 226 | Files.walkFileTree(Paths.get(folder), new SimpleFileVisitor<>() { |
| 227 | + @NotNull |
226 | 228 | @Override |
227 | | - public FileVisitResult preVisitDirectory(Path file, BasicFileAttributes attrs) { |
| 229 | + public FileVisitResult preVisitDirectory(Path file, @NotNull BasicFileAttributes attrs) { |
228 | 230 | if(folderFilter.test(file)) { |
229 | 231 | log.debug("Processing file: {}", file.getFileName().toString()); |
230 | 232 | return FileVisitResult.SKIP_SUBTREE; // Skip the rest of this directory tree |
231 | 233 | } |
232 | 234 | return FileVisitResult.CONTINUE; |
233 | 235 | } |
234 | 236 |
|
| 237 | + @NotNull |
235 | 238 | @Override |
236 | | - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { |
| 239 | + public FileVisitResult visitFile(Path file, @NotNull BasicFileAttributes attrs) { |
237 | 240 | if (attrs.isRegularFile() && !fileFilter.test(file) && attrs.size() > 0) { |
238 | 241 | String filename = file.toString(); |
239 | 242 | Future<String> future = executorService.submit(() -> processor.process(filename, stripDirectory(folder, filename))); |
@@ -292,7 +295,7 @@ public List<String> processFileList(@NonNull String root, @NonNull List<String> |
292 | 295 | if (skipDir) { |
293 | 296 | continue; // skip this file as the folder is not allowed |
294 | 297 | } |
295 | | - String nameLower = path.getFileName().toString().toLowerCase(); |
| 298 | + |
296 | 299 | if (!this.fileFilter.test(path)) { |
297 | 300 | Path fullPath = Path.of(root, file); |
298 | 301 | File f = fullPath.toFile(); |
|
0 commit comments