git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineSmartExecutor@122179 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5338b7f0df
commit
1e8f6f3e3d
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue