Gianpaolo Coro 2013-05-16 14:52:19 +00:00
parent c5b12ad5bf
commit c881102f11
1 changed files with 36 additions and 2 deletions

View File

@ -18,8 +18,8 @@ import org.opengis.metadata.distribution.DigitalTransferOptions;
import org.opengis.metadata.identification.Identification;
public class FeaturesManager {
// private String geonetworkUrl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/";
private String geonetworkUrl = "http://geoserver.d4science-ii.research-infrastructures.eu/geonetwork/";
private String geonetworkUrl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/";
// private String geonetworkUrl = "http://geoserver.d4science-ii.research-infrastructures.eu/geonetwork/";
private String geonetworkUser = "admin";
private String geonetworkPwd = "admin";
private String scope = "/gcube/devsec";
@ -32,6 +32,40 @@ public class FeaturesManager {
this.scope = scope;
}
public String getGeoserverLink(Metadata meta) {
String link = null;
String geoserverString = "/geoserver/";
String wmslink = getWMSLink(meta);
if (wmslink!=null){
int idx = wmslink.indexOf(geoserverString);
if (idx>0){
link = wmslink.substring(0,idx+geoserverString.length()-1);
return link;
}
}
String wfslink = getWFSLink(meta);
if (wfslink!=null){
int idx = wfslink.indexOf(geoserverString);
if (idx>0){
link = wfslink.substring(0,idx+geoserverString.length()-1);
return link;
}
}
String wcslink = getWCSLink(meta);
if (wcslink!=null){
int idx = wcslink.indexOf(geoserverString);
if (idx>0){
link = wcslink.substring(0,idx+geoserverString.length()-1);
return link;
}
}
if (link == null)
System.out.println("NO GEOSERVER LINK WAS FOUND ACCORDING TO THE CRITERION");
return link;
}
private String searchInUrl(Metadata meta, String criterion) {
String link = null;
for (DigitalTransferOptions option : meta.getDistributionInfo().getTransferOptions()) {