org.apache.jackrabbit.extractor
Class EmptyTextExtractor

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

public class EmptyTextExtractor
extends Object
implements TextExtractor

Dummy text extractor that always returns and empty reader for all documents. Useful as a dummy handler for unsupported content types.


Constructor Summary
EmptyTextExtractor(String type)
          Creates a dummy text extractor for the given content type.
EmptyTextExtractor(String[] types)
          Creates a dummy text extractor for the given content types.
 
Method Summary
 Reader extractText(InputStream stream, String type, String encoding)
          Closes the given stream and returns an empty reader.
 String[] getContentTypes()
          Returns the supported content types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyTextExtractor

public EmptyTextExtractor(String[] types)
Creates a dummy text extractor for the given content types. The given array must not be modified after it has been passed to this constructor.

Parameters:
types - supported content types

EmptyTextExtractor

public EmptyTextExtractor(String type)
Creates a dummy text extractor for the given content type.

Parameters:
type - supported content type
Method Detail

getContentTypes

public String[] getContentTypes()
Returns the supported content types.

Specified by:
getContentTypes in interface TextExtractor
Returns:
supported content types

extractText

public Reader extractText(InputStream stream,
                          String type,
                          String encoding)
                   throws IOException
Closes the given stream and returns an empty reader.

Specified by:
extractText in interface TextExtractor
Parameters:
stream - binary stream that simply gets closed
type - ignored
encoding - ignored
Returns:
empty reader
Throws:
IOException - if the binary stream can not be closed


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