From a51830423693a69c21bf649fb7b6cbc8057971dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Mon, 18 Nov 2024 14:49:22 +0100 Subject: [PATCH] Dataset link simplification - improve code comment --- .../linkchecker/service/ServiceDocumentLinkService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/linkchecker/src/main/java/net/geocat/database/linkchecker/service/ServiceDocumentLinkService.java b/services/linkchecker/src/main/java/net/geocat/database/linkchecker/service/ServiceDocumentLinkService.java index e20e258..baffacc 100644 --- a/services/linkchecker/src/main/java/net/geocat/database/linkchecker/service/ServiceDocumentLinkService.java +++ b/services/linkchecker/src/main/java/net/geocat/database/linkchecker/service/ServiceDocumentLinkService.java @@ -81,8 +81,12 @@ public DatasetDocumentLink create(DatasetMetadataRecord datasetMetadataRecord, O } else { result.setProtocol(onlineResource.getProtocol()); - // TODO: review - // Check if protocol inferred is not the same type to the one defined in the protocol field and update it based on the URL inferred protocol + // if the XML document's protocol isn't compatible with the actual URL + // then use the inferred URL protocol. + // Example; + // xml protocol is WMS (view) + // but, url is "...?service=WFS" (inferred url protocol is download and not view) + // then, set the protocol to Download (ignore the XML) if (protocolFromUrl != null) { boolean isDownloadProtocol = ServiceDocumentLink.validDownloadProtocols.contains(onlineResource.getProtocol().toLowerCase()); boolean isDownloadUrlProtocol = ServiceDocumentLink.validDownloadProtocols.contains(protocolFromUrl.toLowerCase());