use of io.quarkus.paths.PathVisitor in project quarkus by quarkusio.
the class ApplicationArchiveBuildStep method indexPathTree.
private static Index indexPathTree(PathTree tree, Set<String> removed) throws IOException {
Indexer indexer = new Indexer();
tree.walk(new PathVisitor() {
@Override
public void visitPath(PathVisit visit) {
final Path path = visit.getPath();
final Path fileName = path.getFileName();
if (fileName == null || !fileName.toString().endsWith(".class") || Files.isDirectory(path) || removed != null && removed.contains(visit.getRelativePath("/"))) {
return;
}
try (InputStream in = Files.newInputStream(path)) {
indexer.index(in);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
});
return indexer.complete();
}
Aggregations