Examples of CssCompressor


Examples of com.yahoo.platform.yui.compressor.CssCompressor

                        (new String(content))
                            .replaceFirst("^/\\*", "/*!")
                            .getBytes(charset)),
                            charset);
        Writer out = new OutputStreamWriter(baos, charset);
        CssCompressor compressor = new CssCompressor(in);
        in.close();
        compressor.compress(out, -1);
        out.flush();
        content = baos.toByteArray();
        out.close();
    }
View Full Code Here

Examples of com.yahoo.platform.yui.compressor.CssCompressor

  private void doCSSCompression(final Reader in, Writer out, final String outputFilename) throws IOException {
    traceVerbose("Start doCSSCompression");

    try {
      // CSS compressor
      final CssCompressor compressor = new CssCompressor(in);

          // Close the input stream first, and then open the output stream,
          // in case the output file should override the input file
          closeObject(in);

          // 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

Examples of com.yahoo.platform.yui.compressor.CssCompressor

  }

  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

Examples of com.yahoo.platform.yui.compressor.CssCompressor

    }

    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

Examples of com.yahoo.platform.yui.compressor.CssCompressor

  @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

Examples of org.ajax4jsf.css.CssCompressor

      responseWriter.endDocument();
      responseWriter.flush();
      responseWriter.close();
     
      if (_CompressStyleOn) {   
            CssCompressor compressor = new CssCompressor(countingOutputWriter.getContent()); // Compressing css document and printing result in response stream
            bytesLength = compressor.compress(writer, -1);
            writer.flush();
            writer.close();
      } else {
            writer.write(countingOutputWriter.getContent().toString())// Write not compressed style content
            bytesLength = countingOutputWriter.getWritten();
View Full Code Here

Examples of org.ajax4jsf.css.CssCompressor

      responseWriter.endDocument();
      responseWriter.flush();
      responseWriter.close();
     
      if (_CompressStyleOn) {   
            CssCompressor compressor = new CssCompressor(countingOutputWriter.getContent()); // Compressing css document and printing result in response stream
            bytesLength = compressor.compress(writer, -1);
            writer.flush();
            writer.close();
      } else {
            writer.write(countingOutputWriter.getContent().toString())// Write not compressed style content
            bytesLength = countingOutputWriter.getWritten();
View Full Code Here

Examples of org.ajax4jsf.css.CssCompressor

      responseWriter.endDocument();
      responseWriter.flush();
      responseWriter.close();
     
      if (_CompressStyleOn) {   
            CssCompressor compressor = new CssCompressor(countingOutputWriter.getContent()); // Compressing css document and printing result in response stream
            bytesLength = compressor.compress(writer, -1);
            writer.flush();
            writer.close();
      } else {
            writer.write(countingOutputWriter.getContent().toString())// Write not compressed style content
            bytesLength = countingOutputWriter.getWritten();
View Full Code Here

Examples of ro.isdc.wro.model.resource.processor.support.CssCompressor

   * {@inheritDoc}
   */
  public void process(final Resource resource, final Reader reader, final Writer writer)
    throws IOException {
    try {
      new CssCompressor(reader).compress(writer, -1);
      writer.flush();
    } catch (final Exception e) {
      final String resourceUri = resource == null ? StringUtils.EMPTY : "[" + resource.getUri() + "]";
      String message = "Exception while applying " + getClass().getSimpleName() + " processor on the "
          + resourceUri + " resource";
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.