Package com.gentics.cr.lucene.indexer.transformer.html

Source Code of com.gentics.cr.lucene.indexer.transformer.html.TidyHelper

package com.gentics.cr.lucene.indexer.transformer.html;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

import org.w3c.tidy.Tidy;

/**
*
* Last changed: $Date: 2009-06-24 17:10:19 +0200 (Mi, 24 Jun 2009) $
* @version $Revision: 99 $
* @author $Author: supnig@constantinopel.at $
*
*/
public class TidyHelper {

  /**
   * Tidy a HTML Stream.
   * @param is
   */
  public static Reader tidy(InputStream is) {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    Tidy tidy = new Tidy();
    tidy.parse(is, out);
    return new InputStreamReader(new ByteArrayInputStream(out.toByteArray()));
  }
}
TOP

Related Classes of com.gentics.cr.lucene.indexer.transformer.html.TidyHelper

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.