@Override public String getTemplate(HandlerContext context) throws IOException { return ResourceUtils.getContentFromInputStream(Thread.currentThread().getContextClassLoader() .getResourceAsStream(PAGE_LOCATION)); }
public static String getFileContentFromClasspath(String pathToFile) { return getFileContentFromClasspath(pathToFile, true); }
public static String getFileContentFromClasspath(String pathToFile, boolean neverFail) { try { InputStream in = getFileFromClasspath(pathToFile); return getContentFromInputStream(in); } catch (IOException e) { StringBuilder sb = new StringBuilder("The content pointed by the path "); sb.append(pathToFile); sb.append(" can't be read from an inputStream."); throw new DandelionException(sb.toString(), e); } }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getContentFromUrl(request, asset.getProcessedConfigLocation(), true); } }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getContentFromUrl(request, asset.getProcessedConfigLocation(), true); } }
@Override public String getTemplate(HandlerContext context) throws IOException { return ResourceUtils.getContentFromInputStream(Thread.currentThread().getContextClassLoader() .getResourceAsStream(PAGE_LOCATION)); }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getContentFromUrl(request, asset.getProcessedConfigLocation(), true); } }
public static String getFileContentFromClasspath(String pathToFile, boolean neverFail) { try { InputStream in = getFileFromClasspath(pathToFile); return getContentFromInputStream(in); } catch (IOException e) { StringBuilder sb = new StringBuilder("The content pointed by the path "); sb.append(pathToFile); sb.append(" can't be read from an inputStream."); throw new DandelionException(sb.toString(), e); } }
public static String getFileContentFromClasspath(String pathToFile) { return getFileContentFromClasspath(pathToFile, true); }
@Override public String getTemplate(HandlerContext context) throws IOException { return ResourceUtils.getContentFromInputStream( Thread.currentThread().getContextClassLoader().getResourceAsStream(PAGE_LOCATION)); }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getContentFromUrl(request, asset.getProcessedConfigLocation(), true); } }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getFileContentFromClasspath(asset.getProcessedConfigLocation(), false); } }
@Override public String getTemplate(HandlerContext context) throws IOException { return ResourceUtils.getContentFromInputStream(Thread.currentThread().getContextClassLoader() .getResourceAsStream(PAGE_LOCATION)); }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getContentFromUrl(request, asset.getProcessedConfigLocation(), true); } }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getFileContentFromClasspath(asset.getProcessedConfigLocation(), false); } }
@Override public String getTemplate(HandlerContext context) throws IOException { return ResourceUtils.getContentFromInputStream(Thread.currentThread().getContextClassLoader() .getResourceAsStream(PAGE_LOCATION)); }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getContentFromUrl(request, asset.getProcessedConfigLocation(), true); } }
public static String prettyPrintJs(String javascript) { String beautifySources = ResourceUtils.getFileContentFromClasspath("dandelion/internal/scripting/beautify.js"); String prettyPrintedJavascript = new ScriptBuilder().addBinding("source", javascript).eval("var global = {};") .eval(beautifySources).eval("prettyPrinted = global.js_beautify(source);").get("prettyPrinted"); return prettyPrintedJavascript; } }
@Override public String getTemplate(HandlerContext context) throws IOException { return ResourceUtils.getContentFromInputStream(Thread.currentThread().getContextClassLoader() .getResourceAsStream(PAGE_LOCATION)); }
@Override protected String doGetContent(Asset asset, Map<String, Object> parameters, HttpServletRequest request) { return ResourceUtils.getContentFromUrl(request, asset.getProcessedConfigLocation(), true); } }