public String compile(String input, boolean compress) throws LessException { try { long time = System.currentTimeMillis(); String result = call(compileString, new Object[] {input, compress}); logger.debug("The compilation of '" + input + "' took " + (System.currentTimeMillis () - time) + " ms."); return result; } catch (Exception e) { throw parseLessException(e); } }
public String compile(URL input, boolean compress) throws LessException { try { long time = System.currentTimeMillis(); logger.debug("Compiling URL: " + input.getProtocol() + ":" + input.getFile()); String result = call(compileFile, new Object[] {input.getProtocol() + ":" + input.getFile(), classLoader, compress}); logger.debug("The compilation of '" + input + "' took " + (System.currentTimeMillis () - time) + " ms."); return result; } catch (Exception e) { throw parseLessException(e); } }
public String compile(File input, boolean compress) throws LessException { try { long time = System.currentTimeMillis(); logger.debug("Compiling File: " + "file:" + input.getAbsolutePath()); String result = call(compileFile, new Object[] {"file:" + input.getAbsolutePath(), classLoader, compress}); logger.debug("The compilation of '" + input + "' took " + (System.currentTimeMillis () - time) + " ms."); return result; } catch (Exception e) { throw parseLessException(e); } }
public void compile(File input, File output, boolean compress) throws LessException, IOException { try { String content = compile(input, compress); if (!output.exists()) { output.createNewFile(); } BufferedWriter bw = new BufferedWriter(new FileWriter(output)); bw.write(content); bw.close(); } catch (Exception e) { throw parseLessException(e); } }