This commit is contained in:
Fabio Sinibaldi 2022-12-06 17:55:49 +01:00
parent de8ed2a811
commit e3960d3d7e
2 changed files with 13 additions and 5 deletions

View File

@ -21,7 +21,9 @@ import org.gcube.application.geoportal.common.model.document.filesets.sdi.GeoSer
import org.gcube.application.geoportal.common.model.document.filesets.sdi.PlatformInfo;
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.data.transfer.library.DataTransferClient;
import org.gcube.data.transfer.library.TransferResult;
import org.gcube.data.transfer.library.client.Client;
import org.gcube.data.transfer.library.faults.*;
import org.gcube.data.transfer.model.Destination;
import org.gcube.data.transfer.model.DestinationClashPolicy;
@ -259,9 +261,15 @@ public class SDIManagerWrapper extends SDIManager{
// remove actual files data
// TODO REMOVE HARDCODED PATCH
String path=gsInfo.getPersistencePath().replace("/srv/geoserver_data","geoserver");
log.info("Deleting files at {} [{}]",path,gsInfo.getPersistencePath());
getDtGeoServer().getWebClient().delete(path);
String path="geoserver/"+gsInfo.getPersistencePath();
log.info("Deleting files at {}@{}",path,getGeoserverHostName());
try{
Client dtClient = new Client("https://"+getGeoserverHostName());
dtClient.delete(path);
// getDtGeoServer().getWebClient().delete("geoserver/"+path);
}catch(Exception e){
throw new Exception("Data Transfer ERROR. Unable to delete files at "+getGeoserverHostName()+" PATH "+path,e);
}
break;
}
@ -273,7 +281,7 @@ public class SDIManagerWrapper extends SDIManager{
}catch(SDIInteractionException e){
throw e;
}catch (Throwable t){
throw new SDIInteractionException("Unexpected exception while trying to materialize File Set "+t.getMessage(),t);
throw new SDIInteractionException("Unexpected exception while trying to delete Layer : "+t.getMessage(),t);
}
}

View File

@ -196,7 +196,7 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
}
// Resetting Document
report.setResultingDocument(Serialization.asDocument(wrapper.getValueCTX().jsonString()));
report.setResultingDocument(Document.parse(wrapper.getValueCTX().jsonString()));
}catch (SDIInteractionException e){
log.error("Unable to materialize "+request,e);
report.setStatus(Report.Status.ERROR);