public void indexMetFile(File file, boolean delete)
throws InstantiationException, FileNotFoundException, IOException,
SolrServerException {
LOG.info("Attempting to index product from metadata file.");
try {
SerializableMetadata metadata = new SerializableMetadata("UTF-8", false);
metadata.loadMetadataFromXmlStream(new FileInputStream(file));
metadata.addMetadata("id", metadata.getMetadata("CAS."
+ CoreMetKeys.PRODUCT_ID));
metadata.addMetadata(config.getProperty(ACCESS_KEY), config
.getProperty(ACCESS_URL)
+ metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));
if (delete) {
server
.deleteById(metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));
}
server.add(this.getSolrDocument(metadata));
LOG.info("Indexed product: "
+ metadata.getMetadata("CAS." + CoreMetKeys.PRODUCT_ID));
} catch (InstantiationException e) {
LOG.severe("Could not instantiate metadata object: " + e.getMessage());
} catch (FileNotFoundException e) {
LOG.severe("Could not find metadata file: " + e.getMessage());
} catch (IOException e) {