GH-1286: filter out hidden files from classpath resources

This commit is contained in:
Martin Lippert
2024-07-03 12:40:19 +02:00
parent 32671aeb92
commit a06c2ca685
2 changed files with 8 additions and 0 deletions

View File

@@ -157,6 +157,14 @@ public class IClasspathUtil {
try {
return Files.walk(folder.toPath())
.filter(path -> Files.isRegularFile(path))
.filter(path -> {
try {
return !Files.isHidden(path);
}
catch (IOException e) {
return false;
}
})
.map(path -> folder.toPath().relativize(path))
.map(relativePath -> relativePath.toString())
.filter(pathString -> !pathString.endsWith(".java") && !pathString.endsWith(".class"));