/** * @param vfs * @param input * @param sourceType * @param callback * @return Returns the processed {@link Resource} * @throws IOException */ public static Resource process(final VFS vfs, final Resource input, final String sourceType, final ProcessorCallback callback) throws IOException { return process(vfs, input, sourceType, sourceType, callback); }
/** * @param vfs * @param resource * @param sourceType * @param callback * @return Returns the processed {@link Resource} * @throws IOException */ public static Resource processAllFilesOfType(final VFS vfs, final Resource resource, final String sourceType, final ProcessorCallback callback) throws IOException { return processAllFilesOfType(vfs, resource, sourceType, sourceType, callback); }
/** * @see de.matrixweb.smaller.resource.Processor#execute(de.matrixweb.vfs.VFS, * de.matrixweb.smaller.resource.Resource, java.util.Map) */ @Override public Resource execute(final VFS vfs, final Resource resource, final Map<String, Object> options) throws IOException { return ProcessorUtil.process(vfs, resource, "css", new ProcessorCallback() { @Override public void call(final Reader reader, final Writer writer) throws IOException { YcssminProcessor.this.executor.run(reader, writer); } }); }
final Map<String, Object> options) throws IOException { try { return ProcessorUtil.process(vfs, resource, "css", new ProcessorCallback() { @Override
private Resource executeWithJs(final VFS vfs, final Resource resource, final Map<String, Object> options) throws IOException { if (this.executor == null) { this.executor = new JavaScriptExecutorFast("uglify-" + this.version, 9, getClass()); this.executor.addScriptSource("module = {};", "rhino.js"); this.executor.addScriptFile(getClass().getResource( "/uglify-" + this.version + "/uglify-js.js")); this.executor.addCallScript("uglify(%s, {});"); } return ProcessorUtil.process(vfs, resource, "js", new ProcessorCallback() { @Override public void call(final Reader reader, final Writer writer) throws IOException { UglifyjsProcessor.this.executor.run(reader, writer); } }); }