Matcher m = PATTERN.matcher(s);
while (m.find()) {
datamodel.put(m.group(1),m.group(2));
}
} catch (Exception e) {
throw new TemplatingException(e.getMessage());
}
//make magic happen
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
templatingService.process(TemplatingService.ADMIN_TPL, datamodel, new OutputStreamWriter(bos));
bytes = bos.toByteArray();
bos.flush();
bos.close();
} catch (Exception e) {
throw new TemplatingException(e.getMessage());
}
return bytes;
}