Skip to content

Commit

Permalink
Hotfix for copernicus node
Browse files Browse the repository at this point in the history
Url is not read from configuration
  • Loading branch information
euskalhenriko committed Feb 11, 2025
1 parent 4061b86 commit ab4096d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public abstract class CopernicusCDSDatacube extends ChunkedDatacubeRepository {

private String dataset;
private String apiKey;
private String apiUrl;

public static final String CDS_API_KEY_PROPERTY = "klab.copernicus.cds.apikey";
public static final String CDS_API_URL = "klab.copernicus.cds.url";
Expand Down Expand Up @@ -66,12 +67,15 @@ public CopernicusCDSDatacube(String dataset, ITimeInstant dataStart, double noDa
Configuration.INSTANCE.getDataPath("copernicus/" + dataset), noDataValue);
this.dataset = dataset;

this.apiUrl = Configuration.INSTANCE.getProperties().getProperty(CDS_API_URL);
this.apiKey = Configuration.INSTANCE.getProperties().getProperty(CDS_API_KEY_PROPERTY);
if (this.apiKey == null) {
setOnline(false, "Copernicus CDS datacube: no CDS credentials provided in configuration");
if (this.apiKey == null || this.apiUrl == null) {
setOnline(false, "Copernicus CDS datacube: no CDS url or api key provided in configuration");
} else {
setOnline(true, null);
}


}

protected Geoserver initializeGeoserver() {
Expand Down Expand Up @@ -254,7 +258,7 @@ protected boolean downloadChunk(int chunk, String variable, File destinationDire
}

public String getEndpointUrl(String request) {
return CDS_API_URL + request;
return this.apiUrl + request;
}

@Override
Expand Down

0 comments on commit ab4096d

Please sign in to comment.