templateContext.set("core", core);
templateContext.set("currentSone", soneProperties);
templateContext.set("currentEdition", core.getUpdateChecker().getLatestEdition());
templateContext.set("version", SonePlugin.VERSION);
StringWriter writer = new StringWriter();
StringBucket bucket = null;
try {
template.render(templateContext, writer);
bucket = new StringBucket(writer.toString(), utf8Charset);
return new ManifestElement(name, bucket, contentType, bucket.size());
} catch (TemplateException te1) {
logger.log(Level.SEVERE, String.format("Could not render template “%s”!", templateName), te1);
return null;
} finally {
Closer.close(writer);
if (bucket != null) {
bucket.free();
}
}
}