Constants.JCR_DATA, 0), ItemType.PROPERTY));
// index if have jcr:mimeType sibling for this binary property only
try
{
DocumentReader dreader =
extractor.getDocumentReader(new String(pmime.getValues().get(0).getAsByteArray()));
data = propData.getValues();
if (data == null)
log.warn("null value found at property " + prop.getQPath().getAsString());
// check the jcr:encoding property
PropertyData encProp =
(PropertyData)stateProvider.getItemData(node, new QPathEntry(Constants.JCR_ENCODING, 0),
ItemType.PROPERTY);
if (encProp != null)
{
// encoding parameter used
String encoding = new String(encProp.getValues().get(0).getAsByteArray());
for (ValueData pvd : data)
{
InputStream is = null;
try
{
is = pvd.getAsStream();
Reader reader = new StringReader(dreader.getContentAsText(is, encoding));
doc.add(createFulltextField(reader));
}
finally
{
try
{
is.close();
}
catch (Throwable e)
{
}
}
}
}
else
{
// no encoding parameter
for (ValueData pvd : data)
{
InputStream is = null;
try
{
is = pvd.getAsStream();
Reader reader = new StringReader(dreader.getContentAsText(is));
doc.add(createFulltextField(reader));
}
finally
{
try