use of com.google.common.base.Strings in project opennms by OpenNMS.
the class IconSelectionDialog method getElementsToShow.
private List<String> getElementsToShow() {
final String opennmsHomeStr = System.getProperty("opennms.home", "");
final String propertiesFilename = "org.opennms.features.topology.app.icons.list";
final Path configPath = Paths.get(opennmsHomeStr, "etc", propertiesFilename);
try {
List<String> strings = Files.readAllLines(configPath);
return strings.stream().filter(s -> s != null && s.trim().length() > 0 && !s.trim().startsWith("#")).collect(Collectors.toList());
} catch (IOException e) {
LoggerFactory.getLogger(getClass()).error("Could not read icon config file {}", configPath, e);
}
return Lists.newArrayList();
}
Aggregations