diff --git a/src/main/java/org/lobid/resources/run/CulturegraphXmlFilterHbzToJson.java b/src/main/java/org/lobid/resources/run/CulturegraphXmlFilterHbzToJson.java index 605828c76..1ed54a567 100644 --- a/src/main/java/org/lobid/resources/run/CulturegraphXmlFilterHbzToJson.java +++ b/src/main/java/org/lobid/resources/run/CulturegraphXmlFilterHbzToJson.java @@ -3,6 +3,7 @@ package org.lobid.resources.run; import java.io.File; +import java.io.FileNotFoundException; import org.metafacture.biblio.marc21.MarcXmlHandler; import org.metafacture.elasticsearch.JsonToElasticsearchBulk; @@ -11,7 +12,6 @@ import org.metafacture.io.ObjectWriter; import org.metafacture.json.JsonEncoder; import org.metafacture.mangling.LiteralToObject; -import org.metafacture.metamorph.Filter; import org.metafacture.strings.StringReader; import org.metafacture.xml.XmlDecoder; import org.metafacture.xml.XmlElementSplitter; @@ -54,13 +54,17 @@ public static void main(String... args) { private static StringReader receiverThread() { final StringReader sr = new StringReader(); - sr.setReceiver(new XmlDecoder()).setReceiver(new MarcXmlHandler()) - .setReceiver( - new Metafix("src/main/resources/fix-cg-to-es.fix")) - .setReceiver(new JsonEncoder()) - .setReceiver(new JsonToElasticsearchBulk("rvk", - ELASTICSEARCH_INDEX_NAME)) - .setReceiver(new ObjectWriter<>(JSON_FILE)); + try { + sr.setReceiver(new XmlDecoder()).setReceiver(new MarcXmlHandler()) + .setReceiver( + new Metafix("src/main/resources/fix-cg-to-es.fix")) + .setReceiver(new JsonEncoder()) + .setReceiver(new JsonToElasticsearchBulk("rvk", + ELASTICSEARCH_INDEX_NAME)) + .setReceiver(new ObjectWriter<>(JSON_FILE)); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } return sr; } }