org.apache.tika.detect
Class POIFSContainerDetector

java.lang.Object
  extended by org.apache.tika.detect.POIFSContainerDetector
All Implemented Interfaces:
java.io.Serializable, ContainerDetector, Detector

public class POIFSContainerDetector
extends java.lang.Object
implements ContainerDetector

A detector that works on a POIFS OLE2 document to figure out exactly what the file is. This should work for all OLE2 documents, whether they are ones supported by POI or not.

See Also:
Serialized Form

Constructor Summary
POIFSContainerDetector()
           
 
Method Summary
 MediaType detect(java.io.InputStream input, Metadata metadata)
          Detect on the generic input stream, if possible.
 MediaType detect(TikaInputStream stream, Metadata metadata)
          Does full, container aware detection for the file of the appropriate container type.
protected  MediaType detectCorel(org.apache.poi.poifs.filesystem.DirectoryNode directory)
           
 MediaType getDefault()
          What is the default type returned by this detector, when it can't figure out anything more specific?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POIFSContainerDetector

public POIFSContainerDetector()
Method Detail

getDefault

public MediaType getDefault()
Description copied from interface: ContainerDetector
What is the default type returned by this detector, when it can't figure out anything more specific?

Specified by:
getDefault in interface ContainerDetector

detect

public MediaType detect(java.io.InputStream input,
                        Metadata metadata)
                 throws java.io.IOException
Description copied from interface: ContainerDetector
Detect on the generic input stream, if possible. This will generally just return the default, as normally a TikaInputStream is needed for proper detection.

Specified by:
detect in interface ContainerDetector
Specified by:
detect in interface Detector
Parameters:
input - document input stream, or null
metadata - input metadata for the document
Returns:
detected media type, or application/octet-stream
Throws:
java.io.IOException - if the document input stream could not be read

detect

public MediaType detect(TikaInputStream stream,
                        Metadata metadata)
                 throws java.io.IOException
Description copied from interface: ContainerDetector
Does full, container aware detection for the file of the appropriate container type.

Specified by:
detect in interface ContainerDetector
Throws:
java.io.IOException

detectCorel

protected MediaType detectCorel(org.apache.poi.poifs.filesystem.DirectoryNode directory)


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