[
https://issues.apache.org/jira/browse/TIKA-1558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14341527#comment-14341527
]
Nick Burch commented on TIKA-1558:
----------------------------------
As of r1662940, it is now possible to blacklist one or more parsers from being
used by {{DefaultParser}} from the config file, eg with config like:
{code}
<properties>
<parsers>
<parser class="org.apache.tika.parser.DefaultParser">
<parser-exclude
class="org.apache.tika.parser.executable.ExecutableParser"/>
<parser-exclude class="org.apache.tika.parser.ocr.TesseractOCRParser"/>
</parser>
</parsers>
</properties>
{code}
A config file like that will use the normal DefaultParser, but without the
Tesseract or Executable parsers
Is that enough to be able to back out the blacklist service file?
> Create a Parser Blacklist
> -------------------------
>
> Key: TIKA-1558
> URL: https://issues.apache.org/jira/browse/TIKA-1558
> Project: Tika
> Issue Type: New Feature
> Reporter: Tyler Palsulich
> Assignee: Tyler Palsulich
> Fix For: 1.8
>
>
> As talked about in TIKA-1555 and TIKA-1557, it would be nice to be able to
> disable Parsers without pulling their dependencies out. In some cases (e.g.
> disable all ExternalParsers), there may not be an easy way to exclude the
> dependencies via Maven.
> So, an initial design would be to include another file like
> {{META-INF/services/org.apache.tika.parser.Parser.blacklist}}. We create a
> new method {{ServiceLoader#loadServiceProviderBlacklist}}. Then, in
> {{ServiceLoader#loadServiceProviders}}, we remove all elements of the list
> that are assignable to an element in
> {{ServiceLoader#loadServiceProviderBlacklist}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)