private InvDatasetImpl openResolver(
     String urlString, ucar.nc2.util.CancelTask task, Result result) {
   InvCatalogFactory catFactory = new InvCatalogFactory("", false);
   InvCatalogImpl catalog = catFactory.readXML(urlString);
   if (catalog == null) {
     result.errLog.format("Couldnt open Resolver %s %n ", urlString);
     return null;
   }
   StringBuilder buff = new StringBuilder();
   if (!catalog.check(buff)) {
     result.errLog.format("Invalid catalog from Resolver <%s>%n%s%n", urlString, buff.toString());
     result.fatalError = true;
     return null;
   }
   InvDataset top = catalog.getDataset();
   if (top.hasAccess()) return (InvDatasetImpl) top;
   else {
     java.util.List datasets = top.getDatasets();
     return (InvDatasetImpl) datasets.get(0);
   }
 }
示例#2
0
文件: GridUI.java 项目: nbald/thredds
 void setFields(java.util.List fields) {
   fieldChooser.setCollection(fields.iterator());
 }