org.apache.jackrabbit.extractor
Class EmptyTextExtractor

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

public class EmptyTextExtractor
extends java.lang.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(java.lang.String type)
          Creates a dummy text extractor for the given content type.
EmptyTextExtractor(java.lang.String[] types)
          Creates a dummy text extractor for the given content types.
 
Method Summary
 java.io.Reader extractText(java.io.InputStream stream, java.lang.String type, java.lang.String encoding)
          Closes the given stream and returns an empty reader.
 java.lang.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(java.lang.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(java.lang.String type)
Creates a dummy text extractor for the given content type.

Parameters:
type - supported content type
Method Detail

getContentTypes

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

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

extractText

public java.io.Reader extractText(java.io.InputStream stream,
                                  java.lang.String type,
                                  java.lang.String encoding)
                           throws java.io.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:
java.io.IOException - if the binary stream can not be closed


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