airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject git commit: file download for SSHOutputHandler
Date Fri, 11 Jul 2014 19:14:36 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 50c747567 -> f13b4eb0e


file download for SSHOutputHandler


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/f13b4eb0
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/f13b4eb0
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/f13b4eb0

Branch: refs/heads/master
Commit: f13b4eb0eb54ec0f8d9789490cad6a44b5deb5da
Parents: 50c7475
Author: raminder <raminder@apache.org>
Authored: Fri Jul 11 15:14:23 2014 -0400
Committer: raminder <raminder@apache.org>
Committed: Fri Jul 11 15:14:23 2014 -0400

----------------------------------------------------------------------
 .../gfac/ssh/handler/SSHOutputHandler.java      | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f13b4eb0/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
index 1dc48cd..9f90cf3 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
@@ -31,6 +31,7 @@ import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.Constants;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.MappingFactory;
 import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.handler.AbstractHandler;
@@ -164,6 +165,25 @@ public class SSHOutputHandler extends AbstractHandler {
                     List<String> outputList = cluster.listDirectory(app.getOutputDataDirectory());
                     if (outputList.size() == 0 || outputList.get(0).isEmpty()) {
                         OutputUtils.fillOutputFromStdout(output, stdOutStr, stdErrStr,outputArray);
+                        Set<String> strings = output.keySet();
+                        outputArray.clear();
+                        for (String key : strings) {
+                            ActualParameter actualParameter1 = (ActualParameter) output.get(key);
+                            if ("URI".equals(actualParameter1.getType().getType().toString()))
{
+                              	String downloadFile = MappingFactory.toString(actualParameter1);
+                            	cluster.scpFrom(downloadFile, outputDataDir);
+                            	String fileName = downloadFile.substring(downloadFile.lastIndexOf(File.separatorChar)+1,
downloadFile.length());
+                            	String localFile = outputDataDir +  File.separator +fileName;
+								jobExecutionContext.addOutputFile(localFile);
+								MappingFactory.fromString(actualParameter1, localFile);
+								DataObjectType dataObjectType = new DataObjectType();
+                                dataObjectType.setValue(localFile);
+                                dataObjectType.setKey(key);
+                                dataObjectType.setType(DataType.URI);
+                                outputArray.add(dataObjectType);
+                            }
+                        }
+                    
                         break;
                     } else {
                         String valueList = outputList.get(0);


Mime
View raw message