/*=================================================================
* Get the object's content, and ingest the document
*================================================================*/
try
{
AttachmentPart ap = meridio_.getLatestVersionFile((int)docId);
if (null == ap)
{
if (Logging.connectors.isDebugEnabled())
Logging.connectors.debug("Meridio: Failed to get content for document '" + new Long(docId).toString() + "'");
// No document. Delete what's there
activities.deleteDocument(documentIdentifier,docVersion);
i++;
continue;
}
try
{
// Get the file name.
String fileName = ap.getDataHandler().getName();
// Log what we are about to do.
if (Logging.connectors.isDebugEnabled())
Logging.connectors.debug("Meridio: File data is supposedly in "+fileName);
File theTempFile = new File(fileName);
if (theTempFile.isFile())
{
long fileSize = theTempFile.length(); // ap.getSize();
if (activities.checkLengthIndexable(fileSize))
{
InputStream is = new FileInputStream(theTempFile); // ap.getDataHandler().getInputStream();
try
{
repositoryDocument.setBinary(is, fileSize);
if (null != activities)
{
activities.ingestDocument(documentIdentifier, docVersion,
fileURL, repositoryDocument);
}
}
finally
{
is.close();
}
}
else
activities.deleteDocument(documentIdentifier, docVersion);
}
else
{
if (Logging.connectors.isDebugEnabled())
Logging.connectors.debug("Meridio: Expected temporary file was not present - skipping document '"+new Long(docId).toString() + "'");
activities.deleteDocument(documentIdentifier, docVersion);
}
}
finally
{
ap.dispose();
}
}
catch (java.net.SocketTimeoutException ioex)
{