use of javax.tools.StandardLocation.CLASS_OUTPUT in project neo4j by neo4j.
the class ServiceAnnotationProcessor method loadIfExists.
private SortedSet<String> loadIfExists(String path) {
final SortedSet<String> result = new TreeSet<>();
try {
final FileObject file = processingEnv.getFiler().getResource(CLASS_OUTPUT, "", path);
final List<String> lines = new ArrayList<>();
try (BufferedReader in = new BufferedReader(new InputStreamReader(file.openInputStream(), StandardCharsets.UTF_8))) {
String line;
while ((line = in.readLine()) != null) {
lines.add(line);
}
}
lines.stream().map(s -> substringBefore(s, "#")).map(String::trim).filter(StringUtils::isNotEmpty).forEach(result::add);
info("Loaded existing providers: " + result);
} catch (IOException ignore) {
info("No existing providers loaded");
}
return result;
}
Aggregations