org.apache.tika.detect
Interface ContainerDetector

All Superinterfaces:
Detector, java.io.Serializable
All Known Implementing Classes:
POIFSContainerDetector, ZipContainerDetector

public interface ContainerDetector
extends Detector

A detector that knows about the container formats that we support (eg POIFS, Zip), and is able to peek inside them to better figure out the contents. Delegates to another Detector (normally MimeTypes) to handle detection for non container formats. Should normally be used with a TikaInputStream to minimise the memory usage.


Method Summary
 MediaType detect(java.io.InputStream input, Metadata metadata)
          Detect on the generic input stream, if possible.
 MediaType detect(TikaInputStream input, Metadata metadata)
          Does full, container aware detection for the file of the appropriate container type.
 MediaType getDefault()
          What is the default type returned by this detector, when it can't figure out anything more specific?
 

Method Detail

getDefault

MediaType getDefault()
What is the default type returned by this detector, when it can't figure out anything more specific?


detect

MediaType detect(java.io.InputStream input,
                 Metadata metadata)
                 throws java.io.IOException
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 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

MediaType detect(TikaInputStream input,
                 Metadata metadata)
                 throws java.io.IOException
Does full, container aware detection for the file of the appropriate container type.

Throws:
java.io.IOException


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