try (Writer writer = new OutputStreamWriter(byteArrayOutputStream, BladerunnerConf.OUTPUT_ENCODING)) {
browsableNode.filterIndexPage(indexPageContent.toString(), locale, version, writer, requestMode);
}
return new CharResponseContent( browsableNode.root(), byteArrayOutputStream.toString() );
}
catch (IOException | ConfigException | ModelOperationException e) {
throw new ContentProcessingException(e, "Error when trying to write the index page for " + RelativePathUtility.get(app.root().getFileInfoAccessor(), browsableNode.root().dir(), indexPage));
}
}