Gianpaolo Coro 2016-02-02 15:28:03 +00:00
parent 9eacbea92b
commit d19d36488c
1 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,6 @@ package org.gcube.dataanalysis.executor.rscripts.generic;
import java.io.File;
import java.io.FileWriter;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
@ -20,6 +19,7 @@ import org.gcube.dataanalysis.executor.util.StorageUtils;
public abstract class GenericRScript extends StandardLocalExternalAlgorithm {
// FIXED part
protected HashMap<String, String> outputValues = new HashMap<String, String>();
protected LinkedHashMap<String, StatisticalType> output = new LinkedHashMap<String, StatisticalType>();
@ -176,14 +176,16 @@ public abstract class GenericRScript extends StandardLocalExternalAlgorithm {
fw.write(Rlog);
fw.close();
AnalysisLogger.getLogger().debug("Written in " + logfile);
String url = StorageUtils.uploadFilesOnStorage(config.getGcubeScope(), config.getParam("Username"), logfile.getParent(), "/ScriptLogs/" + uuid + "/", logfile.getName());
AnalysisLogger.getLogger().debug("Uploaded on storage: " + url);
String httpurl = "";
String httpurl = StorageUtils.uploadFilesOnStorage(config.getGcubeScope(), config.getParam("Username"), logfile.getParent(), "/ScriptLogs/" + uuid + "/", logfile.getName(),true);
AnalysisLogger.getLogger().debug("Uploaded on storage: " + httpurl);
// String httpurl = url.replace("smp:", "http:");
/*
if (config.getGcubeScope().startsWith("/gcube"))
httpurl = "http://data-d.d4science.org/uri-resolver/smp?smp-uri=" + url + "&fileName=" + logfile.getName() ;
else
httpurl = "http://data.d4science.org/uri-resolver/smp?smp-uri=" + url + "&fileName=" + logfile.getName() ;
*/
AnalysisLogger.getLogger().debug("Deleting log file and returning " + httpurl);
logfile.delete();