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());