org.apache.tika.detect
Class ZipContainerDetector

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

public class ZipContainerDetector
extends java.lang.Object
implements ContainerDetector

A detector that works on a Zip document to figure out exactly what the file is

See Also:
Serialized Form

Constructor Summary
ZipContainerDetector()
           
 
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?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipContainerDetector

public ZipContainerDetector()
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 input,
                        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


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