34197e77 by Ean Schuessler

#4364 use string builder

1 parent 01f33936
......@@ -35,7 +35,7 @@ public class LibreOfficeRenderer {
context.put("Linux_X86_64", "$Linux_X86_64");
context.put("Build", "$Build");
String output = "";
StringBuilder output = new StringBuilder();
int idx = 0;
while (idx < template.length()) {
......@@ -44,12 +44,12 @@ public class LibreOfficeRenderer {
String tmplChunk = template.substring(idx, idx + chunkLength);
SimpleTemplateEngine engine = new SimpleTemplateEngine();
Writable stTemplate = engine.createTemplate(tmplChunk).make(context);
output += stTemplate.toString();
output.append(stTemplate.toString());
idx += chunkLength;
}
File outputFile = File.createTempFile("bfdcs-", "-tmpl");
UtilIO.writeString(outputFile, output);
UtilIO.writeString(outputFile, output.toString());
List<String> args = Arrays.asList(new String[]{"libreoffice", "--headless", "--convert-to", "pdf", outputFile.getPath(), "--outdir", "/tmp"});
ProcessBuilder pb = new ProcessBuilder(args);
......