You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Mansour Al Akeel (JIRA)" <ji...@apache.org> on 2016/03/22 01:04:25 UTC
[jira] [Created] (CAMEL-9736) SolrComponent gets the wrong Content
Type
Mansour Al Akeel created CAMEL-9736:
---------------------------------------
Summary: SolrComponent gets the wrong Content Type
Key: CAMEL-9736
URL: https://issues.apache.org/jira/browse/CAMEL-9736
Project: Camel
Issue Type: Improvement
Components: camel-solr
Affects Versions: 2.16.2
Environment: Linux
Reporter: Mansour Al Akeel
Priority: Minor
Fix For: 2.17.0
Currently, there is no way to specify the content type. It's extracted automatically from the File in the body of the Message. This results in error when indexing a document. Setting Exchange.CONTENT_TYPE or Exchange.FILE_CONTENT_TYPE does not help.
For example, neither of these would work, as the component ignores the header and reads the file type in SolrProducer:
if (body instanceof File) {
MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap();
String mimeType = mimeTypesMap.getContentType((File)body);
ContentStreamUpdateRequest updateRequest = new
ContentStreamUpdateRequest(getRequestHandler());
updateRequest.addFile((File) body, mimeType);
A simple solution could be to check if the Exchange.FILE_CONTENT_TYPE is set, before trying to extract if from mimeTypesMap.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)