Package org.apache.tika.parser.microsoft
Class POIFSContainerDetector
java.lang.Object
org.apache.tika.parser.microsoft.POIFSContainerDetector
- All Implemented Interfaces:
Serializable,Detector
A detector that works on a POIFS OLE2 document
to figure out exactly what the file is.
This should work for all OLE2 documents, whether
they are ones supported by POI or not.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MediaTypeSome other kind of embedded document, in a CompObj container within another OLE2 documentstatic final MediaTypeMicrosoft Wordstatic final MediaTypeGeneral embedded document type within an OLE2 containerstatic final MediaTypeHangul Word Processor (Korean)static final MediaTypeMicrosoft Projectstatic final MediaTypeEquation embedded in Office docsstatic final MediaTypeGraph/Charts embedded in PowerPoint and Excelstatic final MediaTypeMicrosoft Outlookstatic final MediaTypeThe OLE base file formatstatic final MediaTypeAn OLE10 Native embedded document within another OLE2 documentstatic final MediaTypeThe protected OOXML base file formatstatic final MediaTypeMicrosoft PowerPointstatic final MediaTypeMicrosoft Publisherstatic final MediaTypeBase QuattroPro mimestatic final MediaTypeStarOffice Drawstatic final MediaTypeStarOffice Calcstatic final MediaTypeStarOffice Impressstatic final MediaTypeStarOffice Writerstatic final MediaTypeSolidWorks CAD filestatic final MediaTypeMicrosoft Visiostatic final MediaTypeMicrosoft Worksstatic final MediaTypeMicrosoft Works Spreadsheet 7.0static final MediaTypeMicrosoft Excel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetect(InputStream input, Metadata metadata) Detects the content type of the given input document.voidsetMarkLimit(int markLimit)
-
Field Details
-
OLE
The OLE base file format -
OOXML_PROTECTED
The protected OOXML base file format -
GENERAL_EMBEDDED
General embedded document type within an OLE2 container -
OLE10_NATIVE
An OLE10 Native embedded document within another OLE2 document -
COMP_OBJ
Some other kind of embedded document, in a CompObj container within another OLE2 document -
MS_GRAPH_CHART
Graph/Charts embedded in PowerPoint and Excel -
MS_EQUATION
Equation embedded in Office docs -
XLS
Microsoft Excel -
DOC
Microsoft Word -
PPT
Microsoft PowerPoint -
PUB
Microsoft Publisher -
VSD
Microsoft Visio -
WPS
Microsoft Works -
XLR
Microsoft Works Spreadsheet 7.0 -
MSG
Microsoft Outlook -
MPP
Microsoft Project -
SDC
StarOffice Calc -
SDA
StarOffice Draw -
SDD
StarOffice Impress -
SDW
StarOffice Writer -
SLDWORKS
SolidWorks CAD file -
HWP
Hangul Word Processor (Korean) -
QUATTROPRO
Base QuattroPro mime
-
-
Constructor Details
-
POIFSContainerDetector
public POIFSContainerDetector()
-
-
Method Details
-
setMarkLimit
public void setMarkLimit(int markLimit) -
detect
Description copied from interface:DetectorDetects the content type of the given input document. Returnsapplication/octet-streamif the type of the document can not be detected.If the document input stream is not available, then the first argument may be
null. Otherwise the detector may read bytes from the start of the stream to help in type detection. The given stream is guaranteed to support themark featureand the detector is expected tomarkthe stream before reading any bytes from it, and toresetthe stream before returning. The stream must not be closed by the detector.The given input metadata is only read, not modified, by the detector.
- Specified by:
detectin interfaceDetector- Parameters:
input- document input stream, ornullmetadata- input metadata for the document- Returns:
- detected media type, or
application/octet-stream - Throws:
IOException- if the document input stream could not be read
-