airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject svn commit: r1478555 - /airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
Date Thu, 02 May 2013 21:13:08 GMT
Author: raminder
Date: Thu May  2 21:12:52 2013
New Revision: 1478555

URL: http://svn.apache.org/r1478555
Log:
in case outputList is coming empty

Modified:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java?rev=1478555&r1=1478554&r2=1478555&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
Thu May  2 21:12:52 2013
@@ -158,14 +158,14 @@ public class GridFTPOutputHandler implem
                         } else if ("URI".equals(actualParameter.getType().getType().toString()))
{
                         	  URI outputURI = GFacUtils.createGsiftpURI(endpoint, app.getOutputDataDirectory());
                               List<String> outputList = ftp.listDir(outputURI, gssCred);
-                              String valueList = outputList.get(0);
-                              if(valueList.isEmpty()){
-                            	  stringMap = OutputUtils.fillOutputFromStdout(output, stdout,
stderr);
-                              }else{
-                              ((URIParameterType) actualParameter.getType()).setValue(valueList);
-                              stringMap = new HashMap<String, ActualParameter>();
-                              stringMap.put(paramName, actualParameter);
-                              }
+							if (outputList.size() == 0 || outputList.get(0).isEmpty()) {
+								stringMap = OutputUtils.fillOutputFromStdout(output, stdout, stderr);
+							} else {
+								String valueList = outputList.get(0);
+								((URIParameterType) actualParameter.getType()).setValue(valueList);
+								stringMap = new HashMap<String, ActualParameter>();
+								stringMap.put(paramName, actualParameter);
+							}
                         }
                         else if ("String".equals(actualParameter.getType().getType().toString()))
{
                         	String path = app.getOutputDataDirectory()+"/"+((StringParameterType)
actualParameter.getType()).getValue();
@@ -309,7 +309,11 @@ public class GridFTPOutputHandler implem
     private static String doStaging(String outputFileStagingPath, String paramValue, GridFtp
ftp, GSSCredential gssCred, String endpoint) throws URISyntaxException, ToolsException {
         URI srcURI = GFacUtils.createGsiftpURI(endpoint, paramValue);
         String fileName = new File(srcURI.getPath()).getName();
-        File outputFile = new File(outputFileStagingPath + File.separator + fileName);
+        File outputpath = new File(outputFileStagingPath);
+        if(!outputpath.exists()){
+        	outputpath.mkdirs();
+        }
+        File outputFile = new File(outputpath.getAbsolutePath() + File.separator + fileName);
         ftp.readRemoteFile(srcURI,
                 gssCred, outputFile);
         return outputFileStagingPath + File.separator + fileName;



Mime
View raw message