Package com.yahoo.platform.yui.compressor

Examples of com.yahoo.platform.yui.compressor.CssCompressor.compress()


          // Get Writer object for output file
          out = openDataWriter(new File(outputFilename), UTF8);

          // Compress file
          compressor.compress(out, -1);
    } finally {
      closeObject(out);
      traceVerbose("End doCSSCompression");
    }
  }
View Full Code Here


  private String compressCss(String content) {
    StringWriter stringWriter = new StringWriter(1024);
    try {
      CssCompressor compressor = new CssCompressor(new StringReader(content));
      compressor.compress(stringWriter, _compressorOptions.getLineBreakPosition());
    } catch (IOException ex) {
      s_logger.error("Unexpected IOException", ex);
    }
    return stringWriter.toString();
  }
View Full Code Here

    private void compressCss(InputStreamReader in, OutputStreamWriter out)
            throws IOException {
        try{
            CssCompressor compressor = new CssCompressor(in);
            compressor.compress(out, linebreakpos);
        }catch(IllegalArgumentException e){
            throw new IllegalArgumentException(
                    "Unexpected characters found in CSS file. Ensure that the CSS file does not contain '$', and try again",e);
        }
    }
View Full Code Here

  @Override
  protected void doProcess(Reader reader, Writer writer, ProcessingContext processingContext) throws Exception {

    try {
      CssCompressor compressor = new CssCompressor(reader);
      compressor.compress(writer, -1);
    }
    catch (IOException e) {
      LOG.error("YUI compressor can't access to the content of {}", processingContext.getAsset().toLog());
      throw DandelionException.wrap(e);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.