public void init() { this.resolver = getResourceResolver(); if (this.root == null) { this.root = "/"; } }
public void init() { this.resolver = getResourceResolver(); if (this.root == null) { this.root = "/"; } }
private Reader getReader(String encoding) throws IOException { Reader reader = null; String resourcePath = toResourcePath(templatePath); Resource resource = getResourceResolver().getResource(resourcePath); if (resource.exists()) { reader = encoding != null ? new java.io.InputStreamReader(resource.getInputStream(), encoding) : new java.io.InputStreamReader(resource.getInputStream()); } return reader; } }
private Reader getReader(String encoding) throws IOException { Reader reader = null; String resourcePath = toResourcePath(templatePath); Resource resource = getResourceResolver().getResource(resourcePath); if (resource.exists()) { reader = encoding != null ? new java.io.InputStreamReader(resource.getInputStream(), encoding) : new java.io.InputStreamReader(resource.getInputStream()); } return reader; } }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getReader() */ public Reader getReader() { Reader reader = null; try { String resourcePath = toResourcePath(scriptPath); Resource resource = getResourceResolver().getResource(resourcePath); if (resource.exists()) { reader = new java.io.InputStreamReader(resource.getInputStream(), "UTF-8"); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return reader; }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getInputStream() */ public InputStream getInputStream() { InputStream is = null; try { String resourcePath = toResourcePath(scriptPath); Resource resource = getResourceResolver().getResource(resourcePath); if (resource.exists()) { is = resource.getInputStream(); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return is; }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getReader() */ public Reader getReader() { Reader reader = null; try { String resourcePath = toResourcePath(scriptPath); Resource resource = getResourceResolver().getResource(resourcePath); if (resource.exists()) { reader = new java.io.InputStreamReader(resource.getInputStream(), "UTF-8"); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return reader; }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getInputStream() */ public InputStream getInputStream() { InputStream is = null; try { String resourcePath = toResourcePath(scriptPath); Resource resource = getResourceResolver().getResource(resourcePath); if (resource.exists()) { is = resource.getInputStream(); } } catch (IOException e) { throw new PlatformRuntimeException( "Unable to load script: " + scriptPath, e); } return is; }