|
21 | 21 |
|
22 | 22 | import java.io.File;
|
23 | 23 | import java.io.FileInputStream;
|
24 |
| -import java.io.InputStream; |
25 | 24 | import java.io.FileNotFoundException;
|
26 | 25 | import java.io.IOException;
|
| 26 | +import java.io.InputStream; |
| 27 | +import java.util.Collection; |
| 28 | +import java.util.Enumeration; |
| 29 | +import java.util.LinkedHashSet; |
27 | 30 | import java.util.Properties;
|
| 31 | +import java.util.regex.Matcher; |
| 32 | +import java.util.regex.Pattern; |
28 | 33 |
|
29 | 34 | import org.apache.maven.plugin.MojoFailureException;
|
30 | 35 | import org.apache.maven.project.MavenProject;
|
@@ -116,4 +121,20 @@ public static void inject(MavenProject project, InputStream properties) throws M
|
116 | 121 | public String getProperty(String key) {
|
117 | 122 | return properties.getProperty(key);
|
118 | 123 | }
|
| 124 | + |
| 125 | + public Collection<String> getKnownAOLs() { |
| 126 | + final Collection<String> result = new LinkedHashSet<String>(); |
| 127 | + final Pattern pattern = Pattern.compile("([^.]+)\\.([^.]+)\\.([^.]+).*"); |
| 128 | + final Enumeration<?> e = properties.propertyNames(); |
| 129 | + while (e.hasMoreElements()) { |
| 130 | + final Object key = e.nextElement(); |
| 131 | + if (key instanceof String) { |
| 132 | + final Matcher matcher = pattern.matcher((String) key); |
| 133 | + if (matcher.matches()) { |
| 134 | + result.add(matcher.group(1) + "-" + matcher.group(2) + "-" + matcher.group(3)); |
| 135 | + } |
| 136 | + } |
| 137 | + } |
| 138 | + return result; |
| 139 | + } |
119 | 140 | }
|
0 commit comments