use of org.apache.tika.parser.microsoft.POIFSContainerDetector in project tika by apache.
the class TikaDetectorsTest method testGetHTML.
@Test
public void testGetHTML() throws Exception {
Response response = WebClient.create(endPoint + DETECTORS_PATH).type("text/html").accept("text/html").get();
String text = getStringFromInputStream((InputStream) response.getEntity());
assertContains("<h2>DefaultDetector</h2>", text);
assertContains("Composite", text);
assertContains("<h3>OggDetector", text);
assertContains("<h3>POIFSContainerDetector", text);
assertContains("<h3>MimeTypes", text);
assertContains(OggDetector.class.getName(), text);
assertContains(POIFSContainerDetector.class.getName(), text);
assertContains(ZipContainerDetector.class.getName(), text);
assertContains(MimeTypes.class.getName(), text);
}
use of org.apache.tika.parser.microsoft.POIFSContainerDetector in project tika by apache.
the class TikaDetectorConfigTest method assertDetectors.
private void assertDetectors(CompositeDetector detector, boolean shouldHavePOIFS, boolean shouldHaveZip) {
boolean hasZip = false;
boolean hasPOIFS = false;
for (Detector d : detector.getDetectors()) {
if (d instanceof ZipContainerDetector) {
if (shouldHaveZip) {
hasZip = true;
} else {
fail("Shouldn't have the ZipContainerDetector from config");
}
}
if (d instanceof POIFSContainerDetector) {
if (shouldHavePOIFS) {
hasPOIFS = true;
} else {
fail("Shouldn't have the POIFSContainerDetector from config");
}
}
}
if (shouldHavePOIFS)
assertTrue("Should have the POIFSContainerDetector", hasPOIFS);
if (shouldHaveZip)
assertTrue("Should have the ZipContainerDetector", hasZip);
}
Aggregations