git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineSmartExecutor@122747 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d19d36488c
commit
97763124f3
|
@ -24,7 +24,6 @@ import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
|
||||||
|
|
||||||
public class StorageUtils {
|
public class StorageUtils {
|
||||||
|
|
||||||
|
|
||||||
public static void downloadInputFile(String fileurl, String destinationFile) throws Exception{
|
public static void downloadInputFile(String fileurl, String destinationFile) throws Exception{
|
||||||
downloadInputFile(fileurl, destinationFile, false);
|
downloadInputFile(fileurl, destinationFile, false);
|
||||||
}
|
}
|
||||||
|
@ -53,14 +52,19 @@ public class StorageUtils {
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String uploadFilesOnStorage(String scope, String user, String localFolder, String remoteFolder, String file) throws Exception {
|
public static String uploadFilesOnStorage(String scope, String user, String localFolder, String remoteFolder, String file, boolean httplink) throws Exception {
|
||||||
try {
|
try {
|
||||||
ScopeProvider.instance.set(scope);
|
ScopeProvider.instance.set(scope);
|
||||||
AnalysisLogger.getLogger().info("Loading file on scope: " + scope);
|
AnalysisLogger.getLogger().info("Loading file on scope: " + scope);
|
||||||
IClient client = new StorageClient(AlgorithmConfiguration.StatisticalManagerClass, AlgorithmConfiguration.StatisticalManagerService, user, AccessType.SHARED, MemoryType.VOLATILE).getClient();
|
IClient client = new StorageClient(AlgorithmConfiguration.StatisticalManagerClass, AlgorithmConfiguration.StatisticalManagerService, user, AccessType.SHARED, MemoryType.VOLATILE).getClient();
|
||||||
String remotef = remoteFolder+file;
|
String remotef = remoteFolder+file;
|
||||||
client.put(true).LFile(new File(localFolder,file).getAbsolutePath()).RFile(remotef);
|
client.put(true).LFile(new File(localFolder,file).getAbsolutePath()).RFile(remotef);
|
||||||
String url = client.getUrl().RFile(remotef);
|
String url = "";
|
||||||
|
if (httplink)
|
||||||
|
url = client.getHttpUrl().RFile(remotef);
|
||||||
|
else
|
||||||
|
url = client.getUrl().RFile(remotef);
|
||||||
|
|
||||||
AnalysisLogger.getLogger().info("Loading finished");
|
AnalysisLogger.getLogger().info("Loading finished");
|
||||||
System.gc();
|
System.gc();
|
||||||
return url;
|
return url;
|
||||||
|
|
Loading…
Reference in New Issue