From d8f3afdf99ddabb10ea4fec5998ce8b6b3f790f7 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Wed, 10 Mar 2021 13:39:23 +0100 Subject: [PATCH] Switch OAI-PMH harvester library Using https://github.com/hbz/oai-harvester2 via jitpack.io See https://github.com/metafacture/metafacture-core/issues/360 --- build.gradle | 1 + metafacture-biblio/build.gradle | 2 +- .../main/java/org/metafacture/biblio/OaiPmhOpener.java | 9 ++++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 3a2e4d071..6647ecb75 100644 --- a/build.gradle +++ b/build.gradle @@ -81,6 +81,7 @@ subprojects { repositories { mavenLocal() mavenCentral() + maven { url 'https://jitpack.io' } } } diff --git a/metafacture-biblio/build.gradle b/metafacture-biblio/build.gradle index 7faf64733..1236c9b2a 100644 --- a/metafacture-biblio/build.gradle +++ b/metafacture-biblio/build.gradle @@ -21,7 +21,7 @@ dependencies { api project(':metafacture-framework') implementation project(':metafacture-commons') implementation project(':metafacture-flowcontrol') - implementation 'org.dspace:oclc-harvester2:0.1.12' + implementation 'com.github.hbz:oai-harvester2:master-SNAPSHOT' implementation ('xalan:xalan:2.7.0') { exclude group: 'xalan', module: 'serializer' exclude group: 'xercesImpl', module: 'xercesImpl' diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java index cfec369c2..664b3de6e 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java @@ -10,7 +10,7 @@ import java.io.Reader; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; +import javax.xml.xpath.XPathException; import org.metafacture.framework.MetafactureException; import org.metafacture.framework.ObjectReceiver; @@ -18,10 +18,9 @@ import org.metafacture.framework.annotations.In; import org.metafacture.framework.annotations.Out; import org.metafacture.framework.helpers.DefaultObjectPipe; +import org.oclc.oai.harvester2.app.RawWrite; import org.xml.sax.SAXException; -import ORG.oclc.oai.harvester2.app.RawWrite; - /** * Opens an OAI-PMH stream and passes a reader to the receiver. * @@ -111,10 +110,10 @@ public void process(final String baseUrl) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); - } catch (TransformerException e) { - e.printStackTrace(); } catch (NoSuchFieldException e) { e.printStackTrace(); + } catch (XPathException e) { + e.printStackTrace(); } try { getReceiver().process(