This commit is contained in:
Fabio Sinibaldi 2013-03-27 15:44:31 +00:00
parent cd20b205b5
commit 1d3be8a750
1 changed files with 15 additions and 4 deletions

View File

@ -17,6 +17,7 @@ import java.util.concurrent.ConcurrentSkipListSet;
import org.gcube.spatial.data.geonetwork.GeoNetwork;
import org.gcube.spatial.data.geonetwork.GeoNetworkPublisher;
import org.gcube.spatial.data.geonetwork.GeoNetworkReader;
import org.gcube.spatial.data.geonetwork.configuration.AuthorizationException;
import org.gcube.spatial.data.gis.model.GeoServerDescriptor;
import org.gcube.spatial.data.gis.model.InfrastructureCrawler;
@ -134,10 +135,20 @@ public class GISInterface {
public void addGeoTIFF(String workspace, String storeName, String coverageName,
File geotiff,String srs,
ProjectionPolicy policy,String defaultStyle, double[] bbox,
Metadata geoNetworkMeta) throws FileNotFoundException, IllegalArgumentException, MalformedURLException,Exception{
GeoServerDescriptor desc=getGeoServerSet(false).last();
GeoServerRESTPublisher publisher=getGeoServerManager(desc.getUrl(), desc.getUser(), desc.getPassword()).getPublisher();
boolean publishResult = publisher.publishGeoTIFF(workspace, storeName, coverageName, geotiff, srs, policy, defaultStyle, bbox);
Metadata geoNetworkMeta) throws FileNotFoundException, IllegalArgumentException, MalformedURLException,AuthorizationException,Exception{
boolean publishResult = false;
try{
GeoServerDescriptor desc=getGeoServerSet(false).last();
GeoServerRESTPublisher publisher=getGeoServerManager(desc.getUrl(), desc.getUser(), desc.getPassword()).getPublisher();
publishResult=publisher.publishGeoTIFF(workspace, storeName, coverageName, geotiff, srs, policy, defaultStyle, bbox);
if(publishResult){
getGN().insertMetadata(geoNetworkMeta);
}
}catch(Exception e){
if(publishResult){
}
}
}