git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/data-transfer/data-transfer-model/1.2@160570 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
693c246600
commit
812232866d
|
@ -31,11 +31,11 @@ public class ThreddsCatalog{
|
||||||
|
|
||||||
|
|
||||||
public String getPathFromLocation(String location) {
|
public String getPathFromLocation(String location) {
|
||||||
if(declaredDataSetRoot!=null&&declaredDataSetRoot.getLocation()!=null&&
|
|
||||||
ThreddsInfo.matchesPath(declaredDataSetRoot.getLocation(),location)) return declaredDataSetRoot.getPath();
|
|
||||||
for(DataSetScan scan : declaredDataSetScan)
|
for(DataSetScan scan : declaredDataSetScan)
|
||||||
if(scan!=null&&scan.getLocation()!=null&&ThreddsInfo.matchesPath(scan.getLocation(), location))
|
if(scan!=null&&scan.getLocation()!=null&&ThreddsInfo.matchesPath(scan.getLocation(), location))
|
||||||
return scan.getPath();
|
return scan.getPath();
|
||||||
|
if(declaredDataSetRoot!=null&&declaredDataSetRoot.getLocation()!=null&&
|
||||||
|
ThreddsInfo.matchesPath(declaredDataSetRoot.getLocation(),location)) return declaredDataSetRoot.getPath();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -52,22 +52,26 @@ public class ThreddsInfo {
|
||||||
if(catalog!=null) {
|
if(catalog!=null) {
|
||||||
if(catalog.getID()!=null&&catalog.getID().equals(id)) return catalog;
|
if(catalog.getID()!=null&&catalog.getID().equals(id)) return catalog;
|
||||||
if(catalog.getSubCatalogs()!=null&&catalog.getSubCatalogs().getLinkedCatalogs()!=null)
|
if(catalog.getSubCatalogs()!=null&&catalog.getSubCatalogs().getLinkedCatalogs()!=null)
|
||||||
for(ThreddsCatalog cat : catalog.getSubCatalogs().getLinkedCatalogs())
|
for(ThreddsCatalog cat : catalog.getSubCatalogs().getLinkedCatalogs()) {
|
||||||
return findById(cat,id);
|
ThreddsCatalog found=findById(cat,id);
|
||||||
|
if(found!=null) return found;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ThreddsCatalog getByFittingLocation(ThreddsCatalog catalog,String toMatchPath) {
|
public static ThreddsCatalog getByFittingLocation(ThreddsCatalog catalog,String toMatchPath) {
|
||||||
if(catalog!=null) {
|
if(catalog!=null) {
|
||||||
if(catalog.getDeclaredDataSetRoot()!=null&&catalog.getDeclaredDataSetRoot().getLocation()!=null&&
|
// if(catalog.getDeclaredDataSetRoot()!=null&&catalog.getDeclaredDataSetRoot().getLocation()!=null&&
|
||||||
matchesPath(catalog.getDeclaredDataSetRoot().getLocation(),toMatchPath)) return catalog;
|
// matchesPath(catalog.getDeclaredDataSetRoot().getLocation(),toMatchPath)) return catalog;
|
||||||
for(DataSetScan scan : catalog.getDeclaredDataSetScan())
|
for(DataSetScan scan : catalog.getDeclaredDataSetScan())
|
||||||
if(scan!=null&&scan.getLocation()!=null&&matchesPath(scan.getLocation(), toMatchPath))
|
if(scan!=null&&scan.getLocation()!=null&&matchesPath(scan.getLocation(), toMatchPath))
|
||||||
return catalog;
|
return catalog;
|
||||||
if(catalog.getSubCatalogs()!=null&&catalog.getSubCatalogs().getLinkedCatalogs()!=null)
|
if(catalog.getSubCatalogs()!=null&&catalog.getSubCatalogs().getLinkedCatalogs()!=null)
|
||||||
for(ThreddsCatalog cat:catalog.getSubCatalogs().getLinkedCatalogs())
|
for(ThreddsCatalog cat:catalog.getSubCatalogs().getLinkedCatalogs()) {
|
||||||
getByFittingLocation(cat, toMatchPath);
|
ThreddsCatalog found=getByFittingLocation(cat, toMatchPath);
|
||||||
|
if(found!=null) return found;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue