if (rds == null) return null;
return openDataset(rds, acquire, task, result);
}
// ready to open it through netcdf API
NetcdfDataset ds;
// open DODS type
if ((serviceType == ServiceType.OPENDAP) || (serviceType == ServiceType.DODS)) {
String curl = DODSNetcdfFile.canonicalURL(datasetLocation);
ds = acquire ? NetcdfDataset.acquireDataset(curl, enhanceMode, task) : NetcdfDataset.openDataset(curl, enhanceMode, task);
}
// open CdmRemote
else if (serviceType == ServiceType.CdmRemote) {
String curl = CdmRemote.canonicalURL(datasetLocation);
ds = acquire ? NetcdfDataset.acquireDataset(curl, enhanceMode, task) : NetcdfDataset.openDataset(curl, enhanceMode, task);
}
/* open ADDE type
else if (serviceType == ServiceType.ADDE) {
try {
ds = ucar.nc2.adde.AddeDatasetFactory.openDataset(access, task);
} catch (IOException e) {
log.append("Cant open as ADDE dataset= "+datasetLocation);
accessList.remove( access);
continue;
}
} */
else {
// open through NetcdfDataset API
ds = acquire ? NetcdfDataset.acquireDataset(datasetLocation, enhanceMode, task) : NetcdfDataset.openDataset(datasetLocation, enhanceMode, task);
}
if (ds != null) {
ds.setId(datasetId);
ds.setTitle(title);
annotate(invDataset, ds);
}
// see if there's metadata LOOK whats this
List list = invDataset.getMetadata(MetadataType.NcML);