rd.setBinary(inputStream, tempFile.length());
rd.setFileName(file.getName());
String contentType = mapExtensionToMimeType(file.getName());
if (contentType != null)
rd.setMimeType(contentType);
rd.addField("lastModified", new Date(file.lastModified()).toString());
int index = 0;
index = setDocumentSecurity(rd,version,index);
index = setPathMetadata(rd,version,index);
StringBuilder ingestURI = new StringBuilder();
index = unpack(ingestURI,version,index,'+');