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