private static SolrInputDocument toSolr(DcsFile file, ArchiveStore store)
throws IOException {
SolrInputDocument doc = new SolrInputDocument();
add(doc, EntityField.ID, file.getId());
add(doc, EntityField.TYPE, EntityTypeValue.FILE.solrValue());
add(doc, FileField.NAME, file.getName());
add(doc, FileField.SOURCE, file.getSource());
add(doc, FileField.SIZE, file.getSizeBytes());
if (file.getValid() != null) {
doc.addField(FileField.VALID.solrName(), file.getValid());
}
doc.addField(FileField.EXTANT.solrName(), file.isExtant());
addFixitySet(doc, file.getFixity());
addFormatSet(doc, file.getFormats());
addResourceIdentifierSet(doc, file.getAlternateIds());
addMetadataSet(doc, file.getMetadata());
addMetadataRefSet(doc, file.getMetadataRef(), EntityField.METADATA_REF,
store);
return doc;
}