Skip to content

Commit

Permalink
Catch FileNotFoundException #1058
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Oct 16, 2023
1 parent 76ad5df commit 8352ce0
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 8352ce0

Please sign in to comment.