git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/data-transfer/data-transfer-model/1.2@160481 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
78cf6a5806
commit
0c51632694
|
@ -33,4 +33,17 @@ public class ThreddsInfo {
|
||||||
private int build;
|
private int build;
|
||||||
private int revision;
|
private int revision;
|
||||||
private String ghnId;
|
private String ghnId;
|
||||||
|
|
||||||
|
|
||||||
|
public ThreddsCatalog getById(String id) {
|
||||||
|
return findById(catalog,id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static ThreddsCatalog findById(ThreddsCatalog catalog,String id) {
|
||||||
|
if(catalog==null||catalog.getID()==null||catalog.getID().equals(id)) return catalog;
|
||||||
|
for(ThreddsCatalog cat : catalog.getSubCatalogs().getLinkedCatalogs())
|
||||||
|
return findById(cat,id);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,6 +289,7 @@ public class MarshallUnmarshalTest {
|
||||||
mainCatalog.setSubCatalogs(collection);
|
mainCatalog.setSubCatalogs(collection);
|
||||||
|
|
||||||
info.setCatalog(mainCatalog);
|
info.setCatalog(mainCatalog);
|
||||||
|
info.getById(subCatalog.getID());
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue