org.alfresco.repo.content
Class TikaOfficeDetectParser

java.lang.Object
  extended by org.alfresco.repo.content.TikaOfficeDetectParser
All Implemented Interfaces:
java.io.Serializable, org.apache.tika.parser.Parser

public class TikaOfficeDetectParser
extends java.lang.Object
implements org.apache.tika.parser.Parser

Apache Tika assumes that you either know exactly what your content is, or that you'll leave it to auto-detection. Within Alfresco, we usually do know. However, from time to time, we don't know if we have one of the old or one of the new office files (eg .xls and .xlsx). This class allows automatically selects the appropriate old (OLE2) or new (OOXML) Tika parser as required.

See Also:
Serialized Form

Constructor Summary
TikaOfficeDetectParser()
           
 
Method Summary
 java.util.Set getSupportedTypes(org.apache.tika.parser.ParseContext parseContext)
           
 void parse(java.io.InputStream stream, org.xml.sax.ContentHandler handler, org.apache.tika.metadata.Metadata metadata)
          Deprecated. This method will be removed in Apache Tika 1.0.
 void parse(java.io.InputStream stream, org.xml.sax.ContentHandler handler, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TikaOfficeDetectParser

public TikaOfficeDetectParser()
Method Detail

getSupportedTypes

public java.util.Set getSupportedTypes(org.apache.tika.parser.ParseContext parseContext)
Specified by:
getSupportedTypes in interface org.apache.tika.parser.Parser

parse

public void parse(java.io.InputStream stream,
                  org.xml.sax.ContentHandler handler,
                  org.apache.tika.metadata.Metadata metadata,
                  org.apache.tika.parser.ParseContext parseContext)
           throws java.io.IOException,
                  org.xml.sax.SAXException,
                  org.apache.tika.exception.TikaException
Specified by:
parse in interface org.apache.tika.parser.Parser
Throws:
java.io.IOException
org.xml.sax.SAXException
org.apache.tika.exception.TikaException

parse

public void parse(java.io.InputStream stream,
                  org.xml.sax.ContentHandler handler,
                  org.apache.tika.metadata.Metadata metadata)
           throws java.io.IOException,
                  org.xml.sax.SAXException,
                  org.apache.tika.exception.TikaException
Deprecated. This method will be removed in Apache Tika 1.0.

Specified by:
parse in interface org.apache.tika.parser.Parser
Throws:
java.io.IOException
org.xml.sax.SAXException
org.apache.tika.exception.TikaException


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.