+ /**
+ * Creates a new manifest element.
+ *
+ * @param name
+ * The name of the file
+ * @param contentType
+ * The content type of the file
+ * @param templateName
+ * The name of the template to render
+ * @return The manifest element
+ */
+ @SuppressWarnings("synthetic-access")
+ private ManifestElement createManifestElement(String name, String contentType, String templateName) {
+ Template template = templateFactory.createTemplate(new InputStreamReader(getClass().getResourceAsStream(templateName), utf8Charset));
+ template.set("currentSone", sone);
+ StringWriter writer = new StringWriter();
+ template.render(writer);
+ StringBucket bucket = new StringBucket(writer.toString(), utf8Charset);
+ return new ManifestElement(name, bucket, contentType, bucket.size());
+ }
+