/* Utility operations */
protected Set<SystemPackage> createSystemPackages() throws IOException {
final Set<SystemPackage> systemPackages = new LinkedHashSet<SystemPackage>();
final SystemPackageEditor systemPackageEditor = new SystemPackageEditor();
systemPackageEditor.setDefaultVersion(getDefaultVersion());
for (final Resource configuration : resolveConfigurations()) {
LineNumberReader in = null;
try {
in = new LineNumberReader(new InputStreamReader(configuration.getInputStream()));
for (String line; (line = in.readLine()) != null;) {
line = line.trim();
if (line.isEmpty() || line.startsWith("#")) {
// Skip empty lines and comments.
continue;
}
try {
systemPackageEditor.setAsText(line);
final SystemPackage systemPackage = (SystemPackage) systemPackageEditor.getValue();
systemPackages.add(systemPackage);
} catch (final IllegalArgumentException e) {
logger.warn("Could not parse SystemPackage configuration line: {}", e.getMessage());
}
}