airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [2/3] airavata git commit: fixing bug in parentPath dir
Date Wed, 03 May 2017 21:20:03 GMT
fixing bug in parentPath dir


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

Branch: refs/heads/master
Commit: 010b133a251c637297305d12462cac8b8e229087
Parents: 1108b57
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Wed May 3 16:57:37 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Wed May 3 17:19:25 2017 -0400

----------------------------------------------------------------------
 .../gfac/impl/task/SCPDataStageTask.java        | 28 ++++++++++++--------
 1 file changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/010b133a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
index 9a42124..e7451c4 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
@@ -138,15 +138,6 @@ public class SCPDataStageTask implements Task {
             ServerInfo serverInfo = processContext.getComputeResourceServerInfo();
             Session sshSession = Factory.getSSHSession(authenticationInfo, serverInfo);
 
-            //Wildcard for file name. Has to find the correct name.
-            if(fileName.startsWith("*.")){
-                String temp = taskContext.getParentProcessContext().getDataMovementRemoteCluster()
-                        .getFileNameFromExtension(fileName.substring(2), inputPath, sshSession);
-                if(temp != null && temp != ""){
-                    fileName = temp;
-                }
-            }
-
             URI destinationURI = null;
             if (subTaskModel.getDestination().startsWith("dummy")) {
                 destinationURI = TaskUtils.getDestinationURI(taskContext, hostName, inputPath,
fileName);
@@ -163,11 +154,26 @@ public class SCPDataStageTask implements Task {
                 return status;
             }
 
-
             status = new TaskStatus(TaskState.COMPLETED);
 
+            //Wildcard for file name. Has to find the correct name.
+            if(fileName.startsWith("*.")){
+                String destParentPath = (new File(destinationURI.getPath())).getParentFile().getPath();
+                String temp = taskContext.getParentProcessContext().getDataMovementRemoteCluster()
+                        .getFileNameFromExtension(fileName.substring(2), destParentPath,
sshSession);
+                if(temp != null && temp != ""){
+                    fileName = temp;
+                }
+                if(destParentPath.endsWith(File.separator)){
+                    destinationURI = new URI(destParentPath + fileName);
+                }else{
+                    destinationURI = new URI(destParentPath + File.separator + fileName);
+                }
+
+            }
+
             if (processState == ProcessState.INPUT_DATA_STAGING) {
-                inputDataStaging(taskContext, sshSession, sourceURI, destinationURI);
+                    inputDataStaging(taskContext, sshSession, sourceURI, destinationURI);
                 status.setReason("Successfully staged input data");
             } else if (processState == ProcessState.OUTPUT_DATA_STAGING) {
                 makeDir(taskContext, destinationURI);


Mime
View raw message