org.apache.jackrabbit.extractor
Class PlainTextExtractor

java.lang.Object
  extended by org.apache.jackrabbit.extractor.AbstractTextExtractor
      extended by org.apache.jackrabbit.extractor.PlainTextExtractor
All Implemented Interfaces:
TextExtractor

public class PlainTextExtractor
extends AbstractTextExtractor

Text extractor for plain text.


Constructor Summary
PlainTextExtractor()
          Creates a new PlainTextExtractor instance.
 
Method Summary
 Reader extractText(InputStream stream, String type, String encoding)
          Wraps the given input stream to an InputStreamReader using the given encoding, or the platform default encoding if the encoding is not given.
 
Methods inherited from class org.apache.jackrabbit.extractor.AbstractTextExtractor
getContentTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainTextExtractor

public PlainTextExtractor()
Creates a new PlainTextExtractor instance.

Method Detail

extractText

public Reader extractText(InputStream stream,
                          String type,
                          String encoding)
                   throws IOException
Wraps the given input stream to an InputStreamReader using the given encoding, or the platform default encoding if the encoding is not given. Closes the stream and returns an empty reader if the given encoding is not supported.

Parameters:
stream - binary stream
type - ignored
encoding - character encoding, optional
Returns:
reader for the plain text content
Throws:
IOException - if the binary stream can not be closed in case of an encoding issue


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.