Skip to content

Commit 1cb1b00

Browse files
authored
Merge pull request #1497 from lesserwhirls/gh-1496
Extend DatasetUrl to identify the gcdm protocol
2 parents 797debc + 6ecd492 commit 1cb1b00

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

cdm/core/src/main/java/thredds/client/catalog/ServiceType.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*
2-
* Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata
2+
* Copyright (c) 1998-2025 University Corporation for Atmospheric Research/Unidata
33
* See LICENSE for license information.
44
*/
5+
56
package thredds.client.catalog;
67

78
/**
@@ -42,7 +43,7 @@ public enum ServiceType {
4243
AccessType.DataAccess, null), //
4344
WMS("Supports access to georegistered map images from geoscience datasets.", AccessType.DataAccess, null), //
4445
WSDL, //
45-
;
46+
GCDM("gRPC services for the Common Data Model", AccessType.DataAccess, "gcdm");
4647

4748
private final String desc;
4849
private final String protocol;

cdm/core/src/main/java/ucar/nc2/dataset/DatasetUrl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ private static ServiceType searchFragment(String fragment) {
232232
return ServiceType.THREDDS;
233233
if (protocol.equalsIgnoreCase("ncml"))
234234
return ServiceType.NCML;
235+
if (protocol.equalsIgnoreCase("gcdm"))
236+
return ServiceType.GCDM;
235237
}
236238
return null;
237239
}
@@ -338,6 +340,8 @@ private static ServiceType decodeLeadProtocol(String protocol) {
338340
return ServiceType.CdmRemote;
339341
case "thredds":
340342
return ServiceType.THREDDS;
343+
case "gcdm":
344+
return ServiceType.GCDM;
341345
}
342346

343347
return null;

cdm/core/src/test/java/ucar/nc2/dataset/TestDatasetUrl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*
2-
* Copyright (c) 1998-2018 John Caron and University Corporation for Atmospheric Research/Unidata
2+
* Copyright (c) 1998-2025 John Caron and University Corporation for Atmospheric Research/Unidata
33
* See LICENSE for license information.
44
*/
5+
56
package ucar.nc2.dataset;
67

78
import static com.google.common.truth.Truth.assertThat;
@@ -123,6 +124,10 @@ public void testFindDatasetUrl() throws IOException {
123124
testFind("cdms3:thredds-test-data?ncml/testStandalone.ncml#delimiter=/", ServiceType.NCML);
124125
testFind("cdms3:thredds-test-data?ncml/testStandalone.ncml", ServiceType.NCML);
125126
testFind("cdms3://[email protected]/bucket-name?super/long/key.ncml#delimiter=/", ServiceType.NCML);
127+
128+
testFind("gcdm://localhost:8080/some/path/dataset.nc", ServiceType.GCDM);
129+
testFind("gcdm:http://localhost:8080/some/path/dataset.nc", ServiceType.GCDM);
130+
testFind("gcdm:https://some.host.org/some/path/dataset.nc", ServiceType.GCDM);
126131
}
127132

128133
@Test

0 commit comments

Comments
 (0)