/** * Method that processes the provided source and returns the processed contents. * * @param filename name of the file * @param source contents of the file * @param conf application configuration * @return the processed file contents * @throws Exception if any error occurred */ public String process(String filename, String source, Config conf) throws Exception { return process(filename, source, conf, getClass().getClassLoader()); }
private String compile(final List<AssetProcessor> pipeline, final String filename, final MediaType type, final String input) throws Exception { log.debug(" {}", filename); Iterator<AssetProcessor> it = pipeline.iterator(); String output = input; while (it.hasNext()) { AssetProcessor processor = it.next(); if (processor.matches(type) && !processor.excludes(filename)) { String pname = processor.name(); long start = System.currentTimeMillis(); try { log.debug(" executing: {}", pname); output = processor.process(filename, output, conf, loader); } finally { long end = System.currentTimeMillis(); log.debug(" {} took {}ms", pname, end - start); } } } return output; }
/** * Method that processes the provided source and returns the processed contents. * * @param filename name of the file * @param source contents of the file * @param conf application configuration * @return the processed file contents * @throws Exception if any error occurred */ public String process(String filename, String source, Config conf) throws Exception { return process(filename, source, conf, getClass().getClassLoader()); }
private String compile(final List<AssetProcessor> pipeline, final String filename, final MediaType type, final String input) throws Exception { log.debug(" {}", filename); Iterator<AssetProcessor> it = pipeline.iterator(); String output = input; while (it.hasNext()) { AssetProcessor processor = it.next(); if (processor.matches(type) && !processor.excludes(filename)) { String pname = processor.name(); long start = System.currentTimeMillis(); try { log.debug(" executing: {}", pname); output = processor.process(filename, output, conf, loader); } finally { long end = System.currentTimeMillis(); log.debug(" {} took {}ms", pname, end - start); } } } return output; }