POIFSFileSystem fs = new POIFSFileSystem(part.getInputStream());
try {
Metadata metadata = new Metadata();
TikaInputStream stream = null;
DirectoryNode root = fs.getRoot();
POIFSDocumentType type = POIFSDocumentType.detectType(root);
if (root.hasEntry("CONTENTS")
&& root.hasEntry("\u0001Ole")
&& root.hasEntry("\u0001CompObj")
&& root.hasEntry("\u0003ObjInfo")) {
// TIKA-704: OLE 2.0 embedded non-Office document?
stream = TikaInputStream.get(
fs.createDocumentInputStream("CONTENTS"));
if (embeddedExtractor.shouldParseEmbedded(metadata)) {
embeddedExtractor.parseEmbedded(