@Override public Reader getReader() throws IOException { return getWrappedRepresentation().getReader(); }
/** * Returns a FreeMarker template from a representation and a configuration. * * @param templateRepresentation * The template representation. * @param config * The FreeMarker configuration. * @return The template or null if not found. */ private static Template getTemplate(Representation templateRepresentation, Configuration config) { try { // Instantiate the template with the character set of the template // representation if it has been set, otherwise use UTF-8. if (templateRepresentation.getCharacterSet() != null) { return new Template("template", templateRepresentation .getReader(), config, templateRepresentation .getCharacterSet().getName()); } else { return new Template("template", templateRepresentation .getReader(), config, CharacterSet.UTF_8.getName()); } } catch (IOException e) { Context.getCurrentLogger().warning( "Unable to get the template from the representation " + templateRepresentation.getIdentifier() + ". Error message: " + e.getMessage()); return null; } }