This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new d4a209d  Fixing the issue in generating wildcard file paths
d4a209d is described below

commit d4a209d042dd36fe9f86a706e783c3c3ee8a6ec8
Author: Dimuthu Wannipurage <[email protected]>
AuthorDate: Sun Jun 2 20:25:22 2019 -0400

    Fixing the issue in generating wildcard file paths
---
 .../helix/impl/task/staging/OutputDataStagingTask.java      | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git 
a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
 
b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
index 419ff02..304b2ae 100644
--- 
a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
+++ 
b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/staging/OutputDataStagingTask.java
@@ -115,25 +115,24 @@ public class OutputDataStagingTask extends 
DataStagingTask {
                 String sourceParentPath = (new 
File(sourceURI.getPath())).getParentFile().getPath();
 
                 logger.debug("Destination parent path " + destParentPath + ", 
source parent path " + sourceParentPath);
-                List<String> fileNames;
+                List<String> filePaths;
                 try {
-                    fileNames = 
adaptor.getFileNameFromExtension(sourceFileName, sourceParentPath);
+                    filePaths = 
adaptor.getFileNameFromExtension(sourceFileName, sourceParentPath);
 
                     if (logger.isTraceEnabled()) {
-                        fileNames.forEach(fileName -> logger.trace("File found 
: " + fileName));
+                        filePaths.forEach(fileName -> logger.trace("File found 
: " + fileName));
                     }
 
                 } catch (AgentException e) {
                     throw new TaskOnFailException("Failed to fetch the file 
list from extension " + sourceFileName, false, e);
                 }
 
-                for (String temp : fileNames) {
-                    if (!"".equals(temp)) {
-                        sourceFileName = temp;
-                    } else {
+                for (String subFilePath : filePaths) {
+                    if (subFilePath == null || "".equals(subFilePath)) {
                         logger.warn("Ignoring file transfer as filename is 
empty or null");
                         continue;
                     }
+                    sourceFileName = new File(subFilePath).getName();
                     if (destParentPath.endsWith(File.separator)) {
                         destinationURI = new URI(destParentPath + 
sourceFileName);
                     } else {

Reply via email to