@Test public void testGetDatasetHandles() throws Exception { URI catalogURI = NetCDFUtilityTest.class.getResource("multi_catalog_all.xml").toURI(); InvCatalogFactory factory = new InvCatalogFactory("default", true); InvCatalog catalog = factory.readXML(catalogURI); StringBuilder errorBuilder = new StringBuilder(); if (!catalog.check(errorBuilder)) { throw new IOException(errorBuilder.toString()); } List<InvAccess> handlesFromCatalog = NetCDFUtility.getDatasetHandles(catalog, ServiceType.OPENDAP); assertEquals(handlesFromCatalog.size(), 2); assertEquals(handlesFromCatalog.get(0).getDataset().getName(), "NCEP WaveWatch III: Atlantic (4 min grid)"); assertEquals(handlesFromCatalog.get(1).getDataset().getName(), "NCEP WaveWatch III: Atlantic (10 min grid)"); List<InvDataset> topLevelDatasets = catalog.getDatasets(); assertEquals(topLevelDatasets.size(), 1); assertEquals(topLevelDatasets.get(0).getName(), "NOAA-WW3"); List<InvAccess> handlesFromTopLevelDataset = NetCDFUtility.getDatasetHandles(topLevelDatasets.get(0), ServiceType.OPENDAP); assertEquals(handlesFromCatalog, handlesFromTopLevelDataset); }
public static List<InvAccess> getDatasetHandles(InvCatalog catalog, ServiceType serviceType) { if (catalog == null || serviceType == null) { return Collections.emptyList(); } List<InvAccess> handles = new LinkedList<InvAccess>(); for (InvDataset dataset : catalog.getDatasets()) { handles.addAll(getDatasetHandles(dataset, serviceType)); } return handles; }
NetCDFUtility { public static List<InvAccess> getDatasetHandles(InvCatalog catalog, ServiceType serviceType) { if (catalog == null || serviceType == null) { return Collections.emptyList(); } List<InvAccess> handles = new LinkedList<InvAccess>(); for (InvDataset dataset : catalog.getDatasets()) { handles.addAll(getDatasetHandles(dataset, serviceType)); } return handles; } }
NetCDFUtility { public static List<InvAccess> getDatasetHandles(InvCatalog catalog, ServiceType serviceType) { if (catalog == null || serviceType == null) { return Collections.emptyList(); } List<InvAccess> handles = new LinkedList<InvAccess>(); for (InvDataset dataset : catalog.getDatasets()) { handles.addAll(getDatasetHandles(dataset, serviceType)); } return handles; } private  NetCDFUtility(); }
NetCDFUtility { public static List<InvAccess> getDatasetHandles(InvCatalog catalog, ServiceType serviceType) { if (catalog == null || serviceType == null) { return Collections.emptyList(); } List<InvAccess> handles = new LinkedList<InvAccess>(); for (InvDataset dataset : catalog.getDatasets()) { handles.addAll(getDatasetHandles(dataset, serviceType)); } return handles; } private  NetCDFUtility(); static List<InvAccess> getDatasetHandles(InvCatalog catalog, ServiceType serviceType); static List<InvAccess> getDatasetHandles(InvDataset dataset, ServiceType serviceType); static List<VariableSimpleIF> getDataVariableNames(String url); static List<VariableSimpleIF> getDataVariableNames(FeatureDataset dataset); static DataTypeCollection getDataTypeCollection(String datasetUrl); static boolean hasTimeCoordinate(String location); static boolean hasTimeCoordinate(FeatureDataset featureDataset); static List<String> getDateRange(String threddsURL, String variableName); static Time getTimeBean(String location, String gridSelection); }
NetCDFUtility { public static List<InvAccess> getDatasetHandles(InvCatalog catalog, ServiceType serviceType) { if (catalog == null || serviceType == null) { return Collections.emptyList(); } List<InvAccess> handles = new LinkedList<InvAccess>(); for (InvDataset dataset : catalog.getDatasets()) { handles.addAll(getDatasetHandles(dataset, serviceType)); } return handles; } private  NetCDFUtility(); static List<InvAccess> getDatasetHandles(InvCatalog catalog, ServiceType serviceType); static List<InvAccess> getDatasetHandles(InvDataset dataset, ServiceType serviceType); static List<VariableSimpleIF> getDataVariableNames(String url); static List<VariableSimpleIF> getDataVariableNames(FeatureDataset dataset); static DataTypeCollection getDataTypeCollection(String datasetUrl); static boolean hasTimeCoordinate(String location); static boolean hasTimeCoordinate(FeatureDataset featureDataset); static List<String> getDateRange(String threddsURL, String variableName); static Time getTimeBean(String location, String gridSelection);  }