@Test public void checkSubsetCatalogOnDataset() throws URISyntaxException, IOException { String docBaseUriString = "http: URI docBaseUri = new URI( docBaseUriString ); String catalogAsString = setupCatalogWithNestedDatasets(); InvCatalogFactory fac = InvCatalogFactory.getDefaultFactory( true ); InvCatalogImpl catalog = fac.readXML( catalogAsString, docBaseUri ); InvCatalog resultCatalog = DeepCopyUtils.subsetCatalogOnDataset( catalog, "ds2" ); assertCatalogAsExpected( catalog, docBaseUri ); assertSubsetCatalogOnDatasetAsExpected( resultCatalog, docBaseUri ); }
public static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, String datasetId ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); if ( datasetId == null ) throw new IllegalArgumentException( "Dataset ID may not be null." ); InvDataset ds = catalog.findDatasetByID( datasetId ); if ( ds == null ) throw new IllegalArgumentException( "The dataset ID [" + datasetId + "] does not match the ID of a dataset in the catalog." ); return subsetCatalogOnDataset( catalog, ds ); }
DeepCopyUtils { public static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, String datasetId ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); if ( datasetId == null ) throw new IllegalArgumentException( "Dataset ID may not be null." ); InvDataset ds = catalog.findDatasetByID( datasetId ); if ( ds == null ) throw new IllegalArgumentException( "The dataset ID [" + datasetId + "] does not match the ID of a dataset in the catalog." ); return subsetCatalogOnDataset( catalog, ds ); } }
DeepCopyUtils { public static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, String datasetId ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); if ( datasetId == null ) throw new IllegalArgumentException( "Dataset ID may not be null." ); InvDataset ds = catalog.findDatasetByID( datasetId ); if ( ds == null ) throw new IllegalArgumentException( "The dataset ID [" + datasetId + "] does not match the ID of a dataset in the catalog." ); return subsetCatalogOnDataset( catalog, ds ); } private  DeepCopyUtils(); }
DeepCopyUtils { public static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, String datasetId ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); if ( datasetId == null ) throw new IllegalArgumentException( "Dataset ID may not be null." ); InvDataset ds = catalog.findDatasetByID( datasetId ); if ( ds == null ) throw new IllegalArgumentException( "The dataset ID [" + datasetId + "] does not match the ID of a dataset in the catalog." ); return subsetCatalogOnDataset( catalog, ds ); } private  DeepCopyUtils(); static InvCatalog copyCatalog( InvCatalog catalog ); static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, String datasetId ); static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, InvDataset dataset); static InvDataset copyDataset( InvDataset dataset, List<InvService> availableServices,
                                        boolean copyInheritedMetadataFromParents ); static InvAccess copyAccess( InvAccess access, InvDataset parentDataset, List<InvService> availableServices ); static InvService copyService( InvService service ); static InvProperty copyProperty( InvProperty property); }
DeepCopyUtils { public static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, String datasetId ) { if ( catalog == null ) throw new IllegalArgumentException( "Catalog may not be null." ); if ( datasetId == null ) throw new IllegalArgumentException( "Dataset ID may not be null." ); InvDataset ds = catalog.findDatasetByID( datasetId ); if ( ds == null ) throw new IllegalArgumentException( "The dataset ID [" + datasetId + "] does not match the ID of a dataset in the catalog." ); return subsetCatalogOnDataset( catalog, ds ); } private  DeepCopyUtils(); static InvCatalog copyCatalog( InvCatalog catalog ); static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, String datasetId ); static InvCatalog subsetCatalogOnDataset( InvCatalog catalog, InvDataset dataset); static InvDataset copyDataset( InvDataset dataset, List<InvService> availableServices,
                                        boolean copyInheritedMetadataFromParents ); static InvAccess copyAccess( InvAccess access, InvDataset parentDataset, List<InvService> availableServices ); static InvService copyService( InvService service ); static InvProperty copyProperty( InvProperty property);  }