.defaultCharset().name() : templateRepresentation.getCharacterSet().getName()); this.template.setLastModified((templateRepresentation .getModificationDate() == null) ? new Date().getTime() : templateRepresentation.getModificationDate().getTime());
/** * Constructor based on a Velocity 'encoded' representation. * * @param templateRepresentation * The representation to 'decode'. * @param mediaType * The representation's media type. * @throws IOException * @throws ParseErrorException * @throws ResourceNotFoundException */ public TemplateRepresentation(Representation templateRepresentation, MediaType mediaType) throws ResourceNotFoundException, ParseErrorException, IOException { super(mediaType); this.engine = null; this.template = new Template(); CharacterSet charSet = (templateRepresentation.getCharacterSet() != null) ? templateRepresentation .getCharacterSet() : CharacterSet.DEFAULT; this.template.setEncoding(charSet.getName()); this.template.setLastModified((templateRepresentation .getModificationDate() == null) ? new Date().getTime() : templateRepresentation.getModificationDate().getTime()); this.template.setName("org.restlet.resource.representation"); this.template.setRuntimeServices(RuntimeSingleton.getRuntimeServices()); this.template.setResourceLoader(new RepresentationResourceLoader( templateRepresentation)); this.template.process(); this.templateName = null; }
.defaultCharset().name() : templateRepresentation.getCharacterSet().getName()); this.template.setLastModified(templateRepresentation .getModificationDate().getTime()); this.template.setName("org.restlet.resource.representation");
this.template.setLastModified(templateRepresentation .getModificationDate().getTime());