git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/spatial-data/gis-interface@71861 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cd20b205b5
commit
1d3be8a750
|
@ -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){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue