[
https://issues.apache.org/jira/browse/TIKA-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ryan McKinley updated TIKA-1014:
--------------------------------
Attachment: TIKA-1014-CustomMimeTypesReader.patch
updated patch with an error handling example.
In this example, the custom reader reads two files that have conflicting glob
patters. The custom handler just logs the warning without failing:
{code:java}
@Override
protected void handleError(MimeType type, String err, Exception ex, String
qName, Attributes attributes) throws SAXException {
if(ERROR_BAD_GLOB.equals(err)) {
ignorePatterns.add( type.toString() + ">>" +
attributes.getValue(PATTERN_ATTR));
}
else {
throw new SAXException(ex);
}
}
{code}
> Allow custom MimeTypesReader
> ----------------------------
>
> Key: TIKA-1014
> URL: https://issues.apache.org/jira/browse/TIKA-1014
> Project: Tika
> Issue Type: New Feature
> Components: mime
> Reporter: Ryan McKinley
> Priority: Minor
> Attachments: TIKA-1014-CustomErrorHandling.patch,
> TIKA-1014-CustomMimeTypesReader.patch, TIKA-1014-CustomMimeTypesReader.patch,
> TIKA-1014-CustomMimeTypesReader.patch
>
>
> The current MimeTypesReader is package protected with private fields. It
> would be great to allow subclassing this Reader to support custom behavior.
> In particular:
> - error handling
> - custom XML tags
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira