Class OPCPackageDetector
- java.lang.Object
-
- org.apache.tika.detect.microsoft.ooxml.OPCPackageDetector
-
- All Implemented Interfaces:
Serializable
,ZipContainerDetector
public class OPCPackageDetector extends Object implements ZipContainerDetector
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OPCPackageDetector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaType
detect(org.apache.commons.compress.archivers.zip.ZipFile zipFile, TikaInputStream stream)
If detection is successful, the ZipDetector should set the zip file or OPCPackage in TikaInputStream.setOpenContainer() Implementations should _not_ close the ZipFilestatic MediaType
detectOfficeOpenXML(org.apache.poi.openxml4j.opc.OPCPackage pkg)
Detects the type of an OfficeOpenXML (OOXML) file from opened Packagestatic Set<String>
parseOOXMLRels(InputStream is)
MediaType
streamingDetectFinal(StreamingDetectContext detectContext)
After we've finished streaming the zip archive entries, a detector may make a final decision.MediaType
streamingDetectUpdate(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zae, InputStream zis, StreamingDetectContext detectContext)
Try to detect on a specific entry.
-
-
-
Method Detail
-
detectOfficeOpenXML
public static MediaType detectOfficeOpenXML(org.apache.poi.openxml4j.opc.OPCPackage pkg)
Detects the type of an OfficeOpenXML (OOXML) file from opened Package
-
parseOOXMLRels
public static Set<String> parseOOXMLRels(InputStream is)
-
detect
public MediaType detect(org.apache.commons.compress.archivers.zip.ZipFile zipFile, TikaInputStream stream) throws IOException
Description copied from interface:ZipContainerDetector
If detection is successful, the ZipDetector should set the zip file or OPCPackage in TikaInputStream.setOpenContainer() Implementations should _not_ close the ZipFile- Specified by:
detect
in interfaceZipContainerDetector
- Returns:
- Throws:
IOException
-
streamingDetectUpdate
public MediaType streamingDetectUpdate(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zae, InputStream zis, StreamingDetectContext detectContext)
Description copied from interface:ZipContainerDetector
Try to detect on a specific entry. Detectors are allowed to store state (e.g. "remember what they've seen") in theStreamingDetectContext
- Specified by:
streamingDetectUpdate
in interfaceZipContainerDetector
- Returns:
-
streamingDetectFinal
public MediaType streamingDetectFinal(StreamingDetectContext detectContext)
Description copied from interface:ZipContainerDetector
After we've finished streaming the zip archive entries, a detector may make a final decision.- Specified by:
streamingDetectFinal
in interfaceZipContainerDetector
- Returns:
-
-