Skip to content

Commit

Permalink
Dataset link simplification - improve code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 committed Nov 18, 2024
1 parent 75a446f commit a518304
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit a518304

Please sign in to comment.