* @throws ResourceInitializationException
* if the locations could not be resolved.
*/
public static String[] resolve(String... patterns) throws ResourceInitializationException {
Set<String> locations = new HashSet<String>();
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
try {
// Scan auto-import locations. Using a set to avoid scanning a pattern twice.
for (String pattern : new TreeSet<String>(Arrays.asList(patterns))) {
String p = pattern.trim();
if (p.length() == 0) {
continue;
}
for (Resource r : resolver.getResources(pattern)) {
locations.add(r.getURL().toString());
}
}
return locations.toArray(new String[locations.size()]);
} catch (IOException e) {