/** * If this dataset has nested datasets. * * @return true if has nested datasets. */ public boolean hasNestedDatasets() { return !getDatasets().isEmpty(); }
/** * If this dataset has nested datasets. * * @return true if has nested datasets. */ public boolean hasNestedDatasets() { return !getDatasets().isEmpty(); }
/** * If this dataset has nested datasets. * * @return true if has nested datasets. */ public boolean hasNestedDatasets() { return !getDatasets().isEmpty(); }
/** * Find an immediate child dataset by its name. * * @param name match on this name * @return dataset if found or null if not exist. */ public InvDatasetImpl findDatasetByName(String name) { for (InvDataset ds : getDatasets()) { if (ds.getName().equals(name)) return (InvDatasetImpl) ds; } return null; }
/** * Find an immediate child dataset by its name. * * @param name match on this name * @return dataset if found or null if not exist. */ public InvDatasetImpl findDatasetByName(String name) { for (InvDataset ds : getDatasets()) { if (ds.getName().equals(name)) return (InvDatasetImpl) ds; } return null; }
public void sortDatasets( InvDataset collectionDs ) { this.sortDatasets( collectionDs.getDatasets() ); }
/** * Find an immediate child dataset by its name. * * @param name match on this name * @return dataset if found or null if not exist. */ public InvDatasetImpl findDatasetByName(String name) { for (InvDataset ds : getDatasets()) { if (ds.getName().equals(name)) return (InvDatasetImpl) ds; } return null; }
public void sortDatasets( InvDataset collectionDs ) { this.sortDatasets( collectionDs.getDatasets() ); }
public void sortDatasets( InvDataset collectionDs ) { this.sortDatasets( collectionDs.getDatasets() ); }
public void sortNestedDatasets( InvDataset collectionDs ) { // Sort grand children datasets. InvDataset curDs = null; for ( java.util.Iterator dsIter = collectionDs.getDatasets().iterator(); dsIter.hasNext(); ) { curDs = (InvDataset) dsIter.next(); // Do not dereference catalogRef or datasetScan. if ( ! curDs.getClass().equals( InvCatalogRef.class ) && ! curDs.getClass().equals( InvDatasetScan.class)) // @todo Move this test into abstract InvDataset.remoteDataset()?? { this.sortDatasets( curDs); } } // Sort child datasets. logger.debug( "sortDatasets(): sort the datasets contained by dataset ({})", collectionDs.getName() ); this.sortDatasets( collectionDs.getDatasets()); return; }
public void sortNestedDatasets( InvDataset collectionDs ) { // Sort grand children datasets. InvDataset curDs = null; for ( java.util.Iterator dsIter = collectionDs.getDatasets().iterator(); dsIter.hasNext(); ) { curDs = (InvDataset) dsIter.next(); // Do not dereference catalogRef or datasetScan. if ( ! curDs.getClass().equals( InvCatalogRef.class ) && ! curDs.getClass().equals( InvDatasetScan.class)) // @todo Move this test into abstract InvDataset.remoteDataset()?? { this.sortDatasets( curDs); } } // Sort child datasets. logger.debug( "sortDatasets(): sort the datasets contained by dataset ({})", collectionDs.getName() ); this.sortDatasets( collectionDs.getDatasets()); return; }
public void sortNestedDatasets( InvDataset collectionDs ) { // Sort grand children datasets. InvDataset curDs = null; for ( java.util.Iterator dsIter = collectionDs.getDatasets().iterator(); dsIter.hasNext(); ) { curDs = (InvDataset) dsIter.next(); // Do not dereference catalogRef or datasetScan. if ( ! curDs.getClass().equals( InvCatalogRef.class ) && ! curDs.getClass().equals( InvDatasetScan.class)) // @todo Move this test into abstract InvDataset.remoteDataset()?? { this.sortDatasets( curDs); } } // Sort child datasets. logger.debug( "sortDatasets(): sort the datasets contained by dataset ({})", collectionDs.getName() ); this.sortDatasets( collectionDs.getDatasets()); return; }
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); } }
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); } }
private void doDataset( InvDataset ds, String fileDir) { if (ds.isHarvest() && (ds.getID() != null)) { String fileOutName = fileDir+"/"+ds.getID()+".dc.xml"; try ( OutputStream out = new BufferedOutputStream(new FileOutputStream(fileOutName))) { writeOneItem(ds, System.out); writeOneItem(ds, out); return; } catch (IOException ioe) { ioe.printStackTrace(); } } for (InvDataset nested : ds.getDatasets()) { doDataset( nested, fileDir); } }
private void doDataset( InvDataset ds, String fileDir) { if (ds.isHarvest() && (ds.getID() != null)) { String fileOutName = fileDir+"/"+ds.getID()+".dc.xml"; try ( OutputStream out = new BufferedOutputStream(new FileOutputStream(fileOutName))) { writeOneItem(ds, System.out); writeOneItem(ds, out); return; } catch (IOException ioe) { ioe.printStackTrace(); } } for (InvDataset nested : ds.getDatasets()) { doDataset( nested, fileDir); } }
void findServices(List<InvService> result, InvDataset ds) { if (ds instanceof InvCatalogRef) return; // look for access elements with unresolved services for (InvAccess a : ds.getAccess()) { InvService s = a.getService(); InvDataset d = a.getDataset(); if (null == d.findService(s.getName()) && !(result.contains(s))) result.add(s); } // recurse into nested datasets for (InvDataset nested : ds.getDatasets()) { findServices(result, nested); } }
void findServices(List<InvService> result, InvDataset ds) { if (ds instanceof InvCatalogRef) return; // look for access elements with unresolved services for (InvAccess a : ds.getAccess()) { InvService s = a.getService(); InvDataset d = a.getDataset(); if (null == d.findService(s.getName()) && !(result.contains(s))) result.add(s); } // recurse into nested datasets for (InvDataset nested : ds.getDatasets()) { findServices(result, nested); } }
void findServices(List<InvService> result, InvDataset ds) { if (ds instanceof InvCatalogRef) return; // look for access elements with unresolved services for (InvAccess a : ds.getAccess()) { InvService s = a.getService(); InvDataset d = a.getDataset(); if (null == d.findService(s.getName()) && !(result.contains(s))) result.add(s); } // recurse into nested datasets for (InvDataset nested : ds.getDatasets()) { findServices(result, nested); } }
void appendToNode(final JTree jTree, List<InvDataset> datasets, MutableTreeNode parentNode, boolean goDeeper) { for (InvDataset dataset : datasets) { final MutableTreeNode deeperParent; if (!goDeeper || !CatalogTreeUtils.isHyraxId(dataset.getID())) { appendToNode(jTree, dataset, parentNode); if (parentNode.getChildCount() == 0) { continue; } deeperParent = (MutableTreeNode) parentNode.getChildAt(parentNode.getChildCount() - 1); } else { deeperParent = parentNode; } if (goDeeper && !(dataset instanceof InvCatalogRef)) { appendToNode(jTree, dataset.getDatasets(), deeperParent, false); } } }