diff --git a/build.gradle b/build.gradle
index 0e7164613..ff2db6079 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,7 +47,8 @@ editorconfig {
'**/*.bzip2',
'**/*.gzip',
'**/*.xz',
- 'gradlew*'
+ 'gradlew*',
+ '**/bin'
]
}
@@ -242,7 +243,7 @@ gradle.projectsEvaluated {
}
}
- //'upload' vs. 'publish, see
+ //'upload' vs. 'publish, see
//https://medium.com/dot-debug/deploying-artifacts-to-maven-using-gradle-b669acc1b6f8'
/*
task publish {
@@ -264,7 +265,7 @@ gradle.projectsEvaluated {
repositories {
maven {
name = 'localEmbedded'
- // run generated gradle task `./gradlew
+ // run generated gradle task `./gradlew
// publishMavenArtifactsPublicationToLocalEmbeddedRepository`
// to publish all subprojects into the same local embedded repo:
url = "file://${rootDir}/build/repo"
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index b31045320..06f410f10 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -6,7 +6,7 @@
-
+
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 908e6d052..d9fa8c424 100644
--- a/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java
+++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/OaiPmhOpener.java
@@ -3,24 +3,24 @@
package org.metafacture.biblio;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathException;
-
import org.metafacture.framework.MetafactureException;
import org.metafacture.framework.ObjectReceiver;
import org.metafacture.framework.annotations.Description;
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 java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathException;
+
/**
* Opens an OAI-PMH stream and passes a reader to the receiver.
*
@@ -114,7 +114,7 @@ public void process(final String baseUrl) {
catch (final NoSuchFieldException e) {
e.printStackTrace();
}
- catch (XPathException e) {
+ catch (final XPathException e) {
e.printStackTrace();
}
try {
diff --git a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/app/RawWrite.java b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/app/RawWrite.java
index 8e4dbe825..6cbce310d 100644
--- a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/app/RawWrite.java
+++ b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/app/RawWrite.java
@@ -31,8 +31,8 @@ public static void main(String[] args) {
try {
System.out.println(new Date());
- HashMap options = getOptions(args);
- List rootArgs = (List) options.get("rootArgs");
+ HashMap options = getOptions(args);
+ List> rootArgs = (List>) options.get("rootArgs");
String baseURL = null;
if (rootArgs.size() > 0) {
baseURL = (String) rootArgs.get(0);
@@ -151,9 +151,9 @@ public static void run(String baseURL, String from, String until,
out.write("\n".getBytes("UTF-8"));
}
- private static HashMap getOptions(String[] args) {
- HashMap options = new HashMap();
- ArrayList rootArgs = new ArrayList();
+ private static HashMap getOptions(String[] args) {
+ HashMap options = new HashMap<>();
+ ArrayList rootArgs = new ArrayList<>();
options.put("rootArgs", rootArgs);
for (int i = 0; i < args.length; ++i) {
diff --git a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListIdentifiers.java b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListIdentifiers.java
index bfeed92a2..6a0c340c5 100644
--- a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListIdentifiers.java
+++ b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListIdentifiers.java
@@ -12,8 +12,11 @@
package org.oclc.oai.harvester2.verb;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
import org.xml.sax.SAXException;
@@ -106,12 +109,13 @@ private static String getRequestURL(String baseURL, String from, String until, S
* @param baseURL
* @param resumptionToken
* @return
+ * @throws UnsupportedEncodingException
*/
private static String getRequestURL(String baseURL,
- String resumptionToken) {
+ String resumptionToken) throws UnsupportedEncodingException {
StringBuilder requestURL = new StringBuilder(baseURL);
requestURL.append("?verb=ListIdentifiers");
- requestURL.append("&resumptionToken=").append(URLEncoder.encode(resumptionToken));
+ requestURL.append("&resumptionToken=").append(URLEncoder.encode(resumptionToken, StandardCharsets.UTF_8.name()));
return requestURL.toString();
}
}
diff --git a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListMetadataFormats.java b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListMetadataFormats.java
index dc50ddeda..0facd07e9 100644
--- a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListMetadataFormats.java
+++ b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/ListMetadataFormats.java
@@ -41,7 +41,7 @@ public ListMetadataFormats() {
* @throws javax.xml.xpath.XPathExpressionException
* @throws IOException an I/O error occurred
*/
- public ListMetadataFormats(String baseURL) throws IOException, ParserConfigurationException,
+ public ListMetadataFormats(String baseURL) throws IOException, ParserConfigurationException,
SAXException, XPathExpressionException {
this(baseURL, null);
}
diff --git a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/OAINamespaceContext.java b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/OAINamespaceContext.java
index 8eb8a7437..ec4033f91 100644
--- a/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/OAINamespaceContext.java
+++ b/metafacture-biblio/src/main/java/org/oclc/oai/harvester2/verb/OAINamespaceContext.java
@@ -36,7 +36,7 @@ public String getPrefix(String namespaceURI) {
}
@Override
- public Iterator getPrefixes(String namespaceURI) {
+ public Iterator> getPrefixes(String namespaceURI) {
return null;
}