Package org.apache.tika.detect.zip
Interface ZipContainerDetector
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FrictionlessPackageDetector
,IPADetector
,IWorkDetector
,JarDetector
,KMZDetector
,OPCPackageDetector
,OpenDocumentDetector
,StarOfficeDetector
Classes that implement this must be able to detect on a ZipFile and in streaming mode.
In streaming mode, each ziparchiventry is "updated" and then
streamingDetectFinal(StreamingDetectContext)
is
called for a final decision.
During streaming detection, state is stored in the StreamingDetectContext
-
Method Summary
Modifier and TypeMethodDescriptiondetect
(org.apache.commons.compress.archivers.zip.ZipFile zipFile, TikaInputStream tis) If detection is successful, the ZipDetector should set the zip file or OPCPackage in TikaInputStream.setOpenContainer() Implementations should _not_ close the ZipFilestreamingDetectFinal
(StreamingDetectContext detectContext) After we've finished streaming the zip archive entries, a detector may make a final decision.streamingDetectUpdate
(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zae, InputStream zis, StreamingDetectContext detectContext) Try to detect on a specific entry.
-
Method Details
-
detect
MediaType detect(org.apache.commons.compress.archivers.zip.ZipFile zipFile, TikaInputStream tis) throws IOException If detection is successful, the ZipDetector should set the zip file or OPCPackage in TikaInputStream.setOpenContainer() Implementations should _not_ close the ZipFile- Parameters:
zipFile
-tis
-- Returns:
- Throws:
IOException
-
streamingDetectUpdate
MediaType streamingDetectUpdate(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zae, InputStream zis, StreamingDetectContext detectContext) throws IOException Try to detect on a specific entry. Detectors are allowed to store state (e.g. "remember what they've seen") in theStreamingDetectContext
- Parameters:
zae
-- Returns:
- Throws:
IOException
-
streamingDetectFinal
After we've finished streaming the zip archive entries, a detector may make a final decision.- Returns:
-