Gianpaolo Coro 2016-01-10 18:51:58 +00:00
parent 5338b7f0df
commit 1e8f6f3e3d
1 changed files with 7 additions and 2 deletions

View File

@ -25,12 +25,17 @@ import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
public class StorageUtils {
public static void downloadInputFile(String fileurl, String destinationFile) throws Exception{
downloadInputFile(fileurl, destinationFile, false);
}
public static void downloadInputFile(String fileurl, String destinationFile, boolean httpURL) throws Exception{
try {
Handler.activateProtocol();
if (!httpURL)
Handler.activateProtocol();
URL smpFile = new URL(fileurl);
URLConnection uc = (URLConnection) smpFile.openConnection();
InputStream is = uc.getInputStream();
AnalysisLogger.getLogger().debug("GenericWorker-> Retrieving from " + fileurl + " to :" + destinationFile);
AnalysisLogger.getLogger().debug("Retrieving from " + fileurl + " to: " + destinationFile);
inputStreamToFile(is, destinationFile);
is.close();
} catch (Exception e) {