private static void addHibernateFilesMatching(final String resourcePath, List<String> filesAlreadyAdded, List<String> ignoredFiles) {
Resource[] ress = CoreSpringFactory.getResources(resourcePath);
for (int i = 0; i < ress.length; i++) {
Resource res = ress[i];
InputStream is;
String fileName = res.getFilename();
if (ignoredFiles.contains(fileName)) {
// then ignore it - dont log either
continue;
}
if (!filesAlreadyAdded.contains(fileName)) {
filesAlreadyAdded.add(fileName);
try {
log.info("Start adding hibernate mapping (xml mapping stream): "+ res.getDescription());
is = res.getInputStream();
cf.addInputStream(is);
log.info("Loaded hibernate mapping (xml mapping stream): "+ res.getDescription());
} catch (IOException e) {
throw new AssertException("i/o error while getting inputstream of resource:"+ res.getDescription());
}
} else {
log.warn("Douplicate hibernate mapping file::" + fileName+ " found on classpath, skipping " + res.toString());
}
}
}