Skip to content
Snippets Groups Projects
Verified Commit 821d62ac authored by Jesper Zedlitz's avatar Jesper Zedlitz
Browse files

remove unnecessary exceptions, fixed a warning message

parent f5f79fb5
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,6 @@ import org.apache.jena.vocabulary.DCTerms; ...@@ -14,7 +14,6 @@ import org.apache.jena.vocabulary.DCTerms;
import org.apache.jena.vocabulary.RDF; import org.apache.jena.vocabulary.RDF;
import org.apache.jena.vocabulary.VCARD4; import org.apache.jena.vocabulary.VCARD4;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.Node; import org.dom4j.Node;
import org.json.JSONArray; import org.json.JSONArray;
...@@ -24,7 +23,6 @@ import org.json.JSONTokener; ...@@ -24,7 +23,6 @@ import org.json.JSONTokener;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
...@@ -630,7 +628,7 @@ public class MDMetadata2Dataset { ...@@ -630,7 +628,7 @@ public class MDMetadata2Dataset {
/** /**
* Convert a {@link Document} containin a gmd:MD_Metadata element into a DCAT-AP.de compliant dcat:Dataset {@link Resource}. * Convert a {@link Document} containin a gmd:MD_Metadata element into a DCAT-AP.de compliant dcat:Dataset {@link Resource}.
*/ */
public Resource convert(Document input) throws DocumentException, IOException { public Resource convert(Document input) {
return convert(input.getRootElement()); return convert(input.getRootElement());
} }
...@@ -829,7 +827,7 @@ public class MDMetadata2Dataset { ...@@ -829,7 +827,7 @@ public class MDMetadata2Dataset {
try { try {
dataset.addProperty(DCATAP.hvdCategory, model.createResource(anchorRef.getStringValue())); dataset.addProperty(DCATAP.hvdCategory, model.createResource(anchorRef.getStringValue()));
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
log.warn("Invalid HVD category {} for dataset {}", characterString.getStringValue(), id); log.warn("Invalid HVD category {} for dataset {}", anchorRef.getStringValue(), id);
} }
} }
} }
...@@ -851,7 +849,7 @@ public class MDMetadata2Dataset { ...@@ -851,7 +849,7 @@ public class MDMetadata2Dataset {
/** /**
* Convert a gmd:MD_Metadata {@link Element} into a DCAT-AP.de compliant dcat:Dataset {@link Resource}. * Convert a gmd:MD_Metadata {@link Element} into a DCAT-AP.de compliant dcat:Dataset {@link Resource}.
*/ */
public Resource convert(Element metadata) throws DocumentException, IOException { public Resource convert(Element metadata) {
if ("GetRecordByIdResponse".equals(metadata.getName())) { if ("GetRecordByIdResponse".equals(metadata.getName())) {
metadata = metadata.element("MD_Metadata"); metadata = metadata.element("MD_Metadata");
...@@ -892,7 +890,6 @@ public class MDMetadata2Dataset { ...@@ -892,7 +890,6 @@ public class MDMetadata2Dataset {
convertDataResource(metadata, dataset); convertDataResource(metadata, dataset);
final Element mdIdentifier = (Element) metadata.selectSingleNode("gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"); final Element mdIdentifier = (Element) metadata.selectSingleNode("gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString");
final String searchId = mdIdentifier != null ? mdIdentifier.getTextTrim() : id; final String searchId = mdIdentifier != null ? mdIdentifier.getTextTrim() : id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment