airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/3] airavata git commit: WIP
Date Fri, 30 Jun 2017 20:39:29 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 2a00dd267 -> 324a9f77e


WIP


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

Branch: refs/heads/develop
Commit: a860fd9c5c7ad69015999a6758b1cb9461a756b2
Parents: 94508b6
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Jun 30 16:38:11 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Jun 30 16:38:11 2017 -0400

----------------------------------------------------------------------
 .../airavata/gfac/impl/HPCRemoteCluster.java       | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a860fd9c/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
index 1e8a2f1..65b4a1b 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
@@ -207,11 +207,20 @@ public class HPCRemoteCluster extends AbstractRemoteCluster{
 			List<String> fileNames = SSHUtils.listDirectory(parentPath, session);
 			List<String> matchingNames = new ArrayList<>();
 			for(String fileName : fileNames){
-				if(fileName.matches(fileRegex)){
-					log.info("File name matched for " + fileRegex + " : " + fileName);
+				String tempFileName = fileName;
+				String[] splits = fileRegex.split("\\*");
+				boolean matching = true;
+				for(String split : splits){
+					if(!tempFileName.contains(split)){
+						matching = false;
+						break;
+					}else{
+						int idx = tempFileName.indexOf(split);
+						tempFileName = tempFileName.substring(idx + split.length());
+					}
+				}
+				if(matching){
 					matchingNames.add(fileName);
-				}else{
-					log.info("File name not matched for " + fileRegex + " : " + fileName);
 				}
 			}
 			log.warn("No matching file found for extension: " + fileRegex + " in the " + parentPath
+ " directory");


Mime
View raw message