InputStream resource = resLocator.getResource(uri);
InputStream resource = resLocator.getResource(uri);
InputStream resource = resLocator.getResource(uri);
InputStream resource = resLocator.getResource(uri);
@Initialize public void intialize() { String trimmedTemplateConfig = templateConfig.trim(); // Only attempt to load as a template resource URI if the configured 'template' // value is all on one line. If it has line breaks then we know it's not an // external resource... if(trimmedTemplateConfig.trim().indexOf('\n') == -1) { try { InputStream templateStream = appContext.getResourceLocator().getResource(trimmedTemplateConfig); if(templateStream != null) { templateConfig = StreamUtils.readStreamAsString(templateStream); } } catch (IOException e) { logger.debug("'template' configuration value '" + trimmedTemplateConfig + "' does not resolve to an external FreeMarker template. Using configured value as the actual template."); } } // Create the template instance... template = new FreeMarkerTemplate(templateConfig); }
@Initialize public void intialize() { String trimmedTemplateConfig = templateConfig.trim(); // Only attempt to load as a template resource URI if the configured 'template' // value is all on one line. If it has line breaks then we know it's not an // external resource... if(trimmedTemplateConfig.trim().indexOf('\n') == -1) { try { InputStream templateStream = appContext.getResourceLocator().getResource(trimmedTemplateConfig); if(templateStream != null) { templateConfig = StreamUtils.readStreamAsString(templateStream); } } catch (IOException e) { logger.debug("'template' configuration value '" + trimmedTemplateConfig + "' does not resolve to an external FreeMarker template. Using configured value as the actual template."); } } // Create the template instance... template = new FreeMarkerTemplate(templateConfig); }
@Initialize public void intialize() { String trimmedTemplateConfig = templateConfig.trim(); // Only attempt to load as a template resource URI if the configured 'template' // value is all on one line. If it has line breaks then we know it's not an // external resource... if(trimmedTemplateConfig.trim().indexOf('\n') == -1) { try { InputStream templateStream = appContext.getResourceLocator().getResource(trimmedTemplateConfig); if(templateStream != null) { templateConfig = StreamUtils.readStreamAsString(templateStream); } } catch (IOException e) { logger.debug("'template' configuration value '" + trimmedTemplateConfig + "' does not resolve to an external FreeMarker template. Using configured value as the actual template."); } } // Create the template instance... template = new FreeMarkerTemplate(templateConfig); }