Package org.apache.tika.detect.zip
Class KMZDetector
- java.lang.Object
-
- org.apache.tika.detect.zip.KMZDetector
-
- All Implemented Interfaces:
Serializable,ZipContainerDetector
public class KMZDetector extends Object implements ZipContainerDetector
This looks for a single file with a name ending in ".kml" at the root level of the zip file.As of Tika 3.2.1, we allow other files at the root level.
We could make this more robust by requiring xml root detection on the *.kml file.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KMZDetector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.tika.mime.MediaTypedetect(org.apache.commons.compress.archivers.zip.ZipFile zip, org.apache.tika.io.TikaInputStream tis)If detection is successful, the ZipDetector should set the zip file or OPCPackage in TikaInputStream.setOpenContainer() Implementations should _not_ close the ZipFileorg.apache.tika.mime.MediaTypestreamingDetectFinal(StreamingDetectContext detectContext)After we've finished streaming the zip archive entries, a detector may make a final decision.org.apache.tika.mime.MediaTypestreamingDetectUpdate(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zae, InputStream zis, StreamingDetectContext detectContext)Try to detect on a specific entry.
-
-
-
Method Detail
-
detect
public org.apache.tika.mime.MediaType detect(org.apache.commons.compress.archivers.zip.ZipFile zip, org.apache.tika.io.TikaInputStream tis) throws IOExceptionDescription copied from interface:ZipContainerDetectorIf detection is successful, the ZipDetector should set the zip file or OPCPackage in TikaInputStream.setOpenContainer() Implementations should _not_ close the ZipFile- Specified by:
detectin interfaceZipContainerDetector- Returns:
- Throws:
IOException
-
streamingDetectUpdate
public org.apache.tika.mime.MediaType streamingDetectUpdate(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zae, InputStream zis, StreamingDetectContext detectContext)Description copied from interface:ZipContainerDetectorTry to detect on a specific entry. Detectors are allowed to store state (e.g. "remember what they've seen") in theStreamingDetectContext- Specified by:
streamingDetectUpdatein interfaceZipContainerDetector- Returns:
-
streamingDetectFinal
public org.apache.tika.mime.MediaType streamingDetectFinal(StreamingDetectContext detectContext)
Description copied from interface:ZipContainerDetectorAfter we've finished streaming the zip archive entries, a detector may make a final decision.- Specified by:
streamingDetectFinalin interfaceZipContainerDetector- Returns:
-
-