ACE-4317 parse emailed potential dbid as a long before using as a solr query parameter

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@115803 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Michael Gardner
2015-11-02 21:29:57 +00:00
parent 80118cac2d
commit f65f6790dd

View File

@@ -456,13 +456,17 @@ public class EmailServiceImpl implements EmailService
ResultSet resultSet = null;
try
{
String query = "@sys\\:node-dbid:" + parts[0];
Long nodeId = Long.parseLong(parts[0]);
String query = "@sys\\:node-dbid:" + nodeId;
resultSet = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, query);
if (resultSet.length() > 0)
{
return resultSet.getNodeRef(0);
}
}
catch (NumberFormatException e)
{
}
finally
{
if(resultSet != null)
@@ -470,6 +474,7 @@ public class EmailServiceImpl implements EmailService
resultSet.close();
}
}
throw new EmailMessageException(ERR_INVALID_NODE_ADDRESS, recipient);
}