public void writeItems( String fileDir) { File dir = new File(fileDir); if (!dir.exists()) { boolean ret = dir.mkdirs(); assert ret; } for (InvDataset dataset : cat.getDatasets()) { doDataset(dataset, fileDir); } }
public void writeItems( String fileDir) { File dir = new File(fileDir); if (!dir.exists()) dir.mkdirs(); List datasets = cat.getDatasets(); for (int i=0; i<datasets.size(); i++) { InvDataset elem = (InvDataset) datasets.get(i); doDataset( elem, fileDir); } }
public void writeItems( String fileDir) { File dir = new File(fileDir); if (!dir.exists()) { boolean ret = dir.mkdirs(); assert ret; } for (InvDataset dataset : cat.getDatasets()) { doDataset(dataset, fileDir); } }
/** * * @param accessPoints * @return the top-level dataset * @throws IOException if the main access point for this DatasetSource is not a container dataset or any of the given access points do not exist or are not under the main access point. */ public InvDataset expand( List accessPoints) throws IOException { // Get the new catalog being generated and its top-level dataset. this.resultingCatalog = this.createSkeletonCatalog( prefixUrlPath ); this.accessPointDataset = (InvDataset) this.resultingCatalog.getDatasets().get( 0); for ( Iterator it = accessPoints.iterator(); it.hasNext(); ) { InvDataset curDs = this.createDataset( (String) it.next(), this.prefixUrlPath ); // Recurse into directory structure and expand. expandRecursiveCollection( this.accessPointDataset, curDs); } // Finish the catalog. ((InvCatalogImpl) this.resultingCatalog).finish(); // Remove empty collection datasets. @todo HACK - should use filters instead. this.recursivelyRemoveEmptyCollectionDatasets( this.accessPointDataset); // Return the top-level dataset. return( this.accessPointDataset); }
private boolean refresh() { String url; if (urlField.getSelectedItem() == null) { url = urlField.getEditor().getItem().toString(); } else { url = urlField.getSelectedItem().toString(); } url = checkCatalogURLString(url); final InvCatalogFactory factory = InvCatalogFactory.getDefaultFactory(true); final InvCatalog catalog = factory.readXML(url); final List<InvDataset> datasets = catalog.getDatasets(); if (datasets.size() == 0) { JOptionPane.showMessageDialog(this, "Cannnot find THREDDS catalog service xml at '" + url + "'"); return false; } urlField.setSelectedItem(url); catalogTree.setNewRootDatasets(datasets); variableFilter.stopFiltering(); return true; }
/** * * @param accessPoints * @return the top-level dataset * @throws IOException if the main access point for this DatasetSource is not a container dataset or any of the given access points do not exist or are not under the main access point. */ public InvDataset expand( List accessPoints) throws IOException { // Get the new catalog being generated and its top-level dataset. this.resultingCatalog = this.createSkeletonCatalog( prefixUrlPath ); this.accessPointDataset = (InvDataset) this.resultingCatalog.getDatasets().get( 0); for ( Iterator it = accessPoints.iterator(); it.hasNext(); ) { InvDataset curDs = this.createDataset( (String) it.next(), this.prefixUrlPath ); // Recurse into directory structure and expand. expandRecursiveCollection( this.accessPointDataset, curDs); } // Finish the catalog. ((InvCatalogImpl) this.resultingCatalog).finish(); // Remove empty collection datasets. @todo HACK - should use filters instead. this.recursivelyRemoveEmptyCollectionDatasets( this.accessPointDataset); // Return the top-level dataset. return( this.accessPointDataset); }
/** * * @param accessPoints * @return the top-level dataset * @throws IOException if the main access point for this DatasetSource is not a container dataset or any of the given access points do not exist or are not under the main access point. */ public InvDataset expand( List accessPoints) throws IOException { // Get the new catalog being generated and its top-level dataset. this.resultingCatalog = this.createSkeletonCatalog( prefixUrlPath ); this.accessPointDataset = (InvDataset) this.resultingCatalog.getDatasets().get( 0); for ( Iterator it = accessPoints.iterator(); it.hasNext(); ) { InvDataset curDs = this.createDataset( (String) it.next(), this.prefixUrlPath ); // Recurse into directory structure and expand. expandRecursiveCollection( this.accessPointDataset, curDs); } // Finish the catalog. ((InvCatalogImpl) this.resultingCatalog).finish(); // Remove empty collection datasets. @todo HACK - should use filters instead. this.recursivelyRemoveEmptyCollectionDatasets( this.accessPointDataset); // Return the top-level dataset. return( this.accessPointDataset); }
this.accessPointDataset = (InvDataset) this.resultingCatalog.getDatasets().get( 0);
this.accessPointDataset = (InvDataset) this.resultingCatalog.getDatasets().get( 0);
this.accessPointDataset = (InvDataset) this.resultingCatalog.getDatasets().get( 0);
public static InvCatalog copyCatalog( InvCatalog catalog ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); InvCatalogImpl resultCatalog = new InvCatalogImpl( catalog.getName(), "1.0", catalog.getExpires(), ((InvCatalogImpl) catalog).getBaseURI() ); List<InvService> copiedServices = copyServicesIntoCopiedCatalog( catalog, resultCatalog ); for ( InvDataset curDs : catalog.getDatasets()) { resultCatalog.addDataset( (InvDatasetImpl) DeepCopyUtils.copyDataset( curDs, copiedServices, false ) ); } resultCatalog.finish(); return resultCatalog; }
public static InvCatalog copyCatalog( InvCatalog catalog ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); InvCatalogImpl resultCatalog = new InvCatalogImpl( catalog.getName(), "1.0", catalog.getExpires(), ((InvCatalogImpl) catalog).getBaseURI() ); List<InvService> copiedServices = copyServicesIntoCopiedCatalog( catalog, resultCatalog ); for ( InvDataset curDs : catalog.getDatasets()) { resultCatalog.addDataset( (InvDatasetImpl) DeepCopyUtils.copyDataset( curDs, copiedServices, false ) ); } resultCatalog.finish(); return resultCatalog; }
public static InvCatalog copyCatalog( InvCatalog catalog ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); InvCatalogImpl resultCatalog = new InvCatalogImpl( catalog.getName(), "1.0", catalog.getExpires(), ((InvCatalogImpl) catalog).getBaseURI() ); List<InvService> copiedServices = copyServicesIntoCopiedCatalog( catalog, resultCatalog ); for ( InvDataset curDs : catalog.getDatasets()) { resultCatalog.addDataset( (InvDatasetImpl) DeepCopyUtils.copyDataset( curDs, copiedServices, false ) ); } resultCatalog.finish(); return resultCatalog; }
List mdataList = findCatGenConfigMdata( this.catalog.getDatasets()); for ( int i = 0; i < mdataList.size(); i++) InvDataset genTopDs = (InvDataset) generatedCat.getDatasets().get( 0);
List mdataList = findCatGenConfigMdata( this.catalog.getDatasets()); for ( int i = 0; i < mdataList.size(); i++) InvDataset genTopDs = (InvDataset) generatedCat.getDatasets().get( 0);