airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [47/54] [abbrv] airavata git commit: resource can have multiple data files
Date Fri, 04 Dec 2015 21:02:12 GMT
resource can have multiple data files


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

Branch: refs/heads/master
Commit: bd1cc2f51a917149dca2f0589828a65b67888731
Parents: 5870ed4
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Dec 4 02:21:36 2015 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Dec 4 02:21:36 2015 -0500

----------------------------------------------------------------------
 .../airavata/data/manager/DataManagerImpl.java       | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/bd1cc2f5/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
index 972abfe..947a061 100644
--- a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
+++ b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
@@ -148,21 +148,22 @@ public class DataManagerImpl implements DataManager{
     public boolean copyResource(String resourceId, String replicaId, String destLocation)
             throws DataManagerException {
         try {
-            //FIXME Bellow implementation is a skeleton code only to support the current
airavata usecase of one to one copy
             DataResourceModel resourceModel = getResource(resourceId);
             DataReplicaLocationModel replicaLocationModel = getReplicaLocation(replicaId);
             if(resourceModel == null)
                 throw new DataManagerException("Non existent resource id:"+resourceId);
             if(replicaLocationModel == null)
                 throw new DataManagerException("Non existent replica id:"+replicaId);
-            URI sourceUri = new URI(replicaLocationModel.getDataLocations().get(0));
+            boolean result;
             URI destinationUri = new URI(destLocation);
-            DataTransferUtils dataTransferUtils = new DataTransferUtils(sshKeyAuthentication);
-            boolean result = dataTransferUtils.copyData(sourceUri, destinationUri);
-            if(result){
-
+            for(String dataLocation : replicaLocationModel.getDataLocations()) {
+                URI sourceUri = new URI(dataLocation);
+                DataTransferUtils dataTransferUtils = new DataTransferUtils(sshKeyAuthentication);
+                result = dataTransferUtils.copyData(sourceUri, destinationUri);
+                if(result == false)
+                    return result;
             }
-            return result;
+            return true;
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
             throw new DataManagerException(e);


Mime
View raw message