public class ContentHandlerExample extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
MAXIMUM_TEXT_CHUNK_SIZE |
Constructor and Description |
---|
ContentHandlerExample() |
Modifier and Type | Method and Description |
---|---|
String |
parseBodyToHTML()
Example of extracting just the body as HTML, without the
head part, as a string
|
String |
parseOnePartToHTML()
Example of extracting just one part of the document's body,
as HTML as a string, excluding the rest
|
String |
parseToHTML()
Example of extracting the contents as HTML, as a string.
|
String |
parseToPlainText()
Example of extracting the plain text of the contents.
|
List<String> |
parseToPlainTextChunks()
Example of extracting the plain text in chunks, with each chunk
of no more than a certain maximum size
|
protected final int MAXIMUM_TEXT_CHUNK_SIZE
public String parseToPlainText() throws IOException, SAXException, TikaException
IOException
SAXException
TikaException
public String parseToHTML() throws IOException, SAXException, TikaException
IOException
SAXException
TikaException
public String parseBodyToHTML() throws IOException, SAXException, TikaException
IOException
SAXException
TikaException
public String parseOnePartToHTML() throws IOException, SAXException, TikaException
IOException
SAXException
TikaException
public List<String> parseToPlainTextChunks() throws IOException, SAXException, TikaException
IOException
SAXException
TikaException
Copyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.