if (!Strings.isNullOrEmpty(dataLoader.file()[0])) {
String configFileName = dataLoader.config();
LOGGER.fine("Loading smooks configuration file " + configFileName);
Smooks smooks = new Smooks(getClass().getResourceAsStream(
configFileName));
ExecutionContext executionContext = smooks.createExecutionContext();
executionContext.getBeanContext().addBean(OFY_HELPER,
getOfyHelperBean());
MapDaoRegister<Object> register = MapDaoRegister
.newInstance(getDAOMap());
PersistenceUtil.setDAORegister(executionContext, register);
for (int i = 0; i < dataLoader.file().length; i++) {
StreamSource streamSource = new StreamSource(this.getClass()
.getResourceAsStream(dataLoader.file()[i]));
smooks.filterSource(executionContext, streamSource,
new Result[] {null});
}
} else {
LOGGER.info("Skipping loading smooks configuration "
+ "file as there is no StreamSource " + "file defined");