Resource<MovieContent> resource = parseResource(record);
resource.getURI().setIdentifier(movieResource.getIdentifier());
resource.setPublished(harvesterUser, date, null);
removeContents(resource);
MovieContent content = parseResourceContent(record);
content.setSource(recordIdentifier);
resource.addContent(content);
addResource(resource);
addContent(resource.getURI(), content);
} else if (searchResult.getHitCount() > 1) {
logger.error("The repository contains already more than one element of {}", recordIdentifier);
} else {
Resource<?> resource = parseResource(record);
resource.setPublished(harvesterUser, date, null);
ResourceContent content = parseResourceContent(record);
if (resource == null || content == null)
return;
addResource(resource);
content.setSource(recordIdentifier);
addContent(resource.getURI(), content);
logger.info("Harvesting resource " + recordIdentifier);
}
}
}