From 6b112cafb1280e3c3b17153d2c391388fdc8365e Mon Sep 17 00:00:00 2001
From: Jesper Zedlitz <jesper@zedlitz.de>
Date: Mon, 20 Jan 2025 12:33:35 +0100
Subject: [PATCH] added GeoJSON as format and made format detection
 case-insensitive

---
 .../java/de/landsh/opendata/csw2dcat/Mapping.java | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/main/java/de/landsh/opendata/csw2dcat/Mapping.java b/src/main/java/de/landsh/opendata/csw2dcat/Mapping.java
index dc1354a..f12fd64 100644
--- a/src/main/java/de/landsh/opendata/csw2dcat/Mapping.java
+++ b/src/main/java/de/landsh/opendata/csw2dcat/Mapping.java
@@ -9,7 +9,6 @@ import org.dom4j.Element;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.util.Objects;
 
@@ -152,22 +151,26 @@ public class Mapping {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/" + format);
         } else if (ArrayUtils.contains(SERVICES, format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/" + format + "_SRVC");
-        } else if ("download".equals(format)) {
+        } else if (StringUtils.equalsIgnoreCase("download", format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/WFS_SRVC");
-        } else if ("view".equals(format)) {
+        } else if (StringUtils.equalsIgnoreCase("view", format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/WMS_SRVC");
-        } else if ("Shapefiles".equals(format) || "Shape".equals(format) || "SHAPE".equals(format) || "ESRI-Shape".equals(format)) {
+        } else if (StringUtils.equalsIgnoreCase("Shapefiles", format)
+                || StringUtils.equalsIgnoreCase("Shape", format)
+                || "ESRI-Shape".equals(format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/SHP");
         } else if ("TIFF 5 Group 4 Fax CCITT, TIFF-LZW (Summenlayer)".equals(format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/TIFF");
         } else if ("predefined ATOM".equals(format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/ATOM");
-        } else if ("Excel".equals(format)) {
+        } else if (StringUtils.equalsIgnoreCase("Excel", format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/XLS");
-        } else if ("GeoTIFF".equals(format)) {
+        } else if (StringUtils.equalsIgnoreCase("GeoTIFF", format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/GEOTIFF");
         } else if ("ARC/INFO-Coverage".equals(format)) {
             return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/ARCINFO_COV");
+        } else if (StringUtils.equalsIgnoreCase("GeoJSON", format)) {
+            return ResourceFactory.createResource("http://publications.europa.eu/resource/authority/file-type/GEOJSON");
         } else if (StringUtils.isEmpty(format)) {
             throw new IllegalArgumentException("Format must not be empty.");
         } else {
-- 
GitLab