if (store.getExtractedText(binaryValue) != null) {
return;
}
String mimeType = binaryValue.getMimeType();
TextExtractorOutput output = new TextExtractorOutput();
// Run through the extractors and have them extract the text - the first one which accepts the mime-type will win
for (TextExtractor extractor : extractors) {
if (!extractor.supportsMimeType(mimeType)) {
continue;
}
extractor.extractFrom(binaryValue, output, context);
break;
}
String extractedText = output.getText();
if (extractedText != null && !StringUtil.isBlank(extractedText)) {
store.storeExtractedText(binaryValue, extractedText);
}
} catch (InterruptedException ie) {
Thread.interrupted();