machristie commented on a change in pull request #28:
URL: https://github.com/apache/airavata-mft/pull/28#discussion_r570487239



##########
File path: 
transport/scp-transport/src/main/java/org/apache/airavata/mft/transport/scp/SCPMetadataCollector.java
##########
@@ -203,17 +204,17 @@ public DirectoryResourceMetadata 
getDirectoryResourceMetadata(String resourceId,
     }
 
     @Override
-    public DirectoryResourceMetadata getDirectoryResourceMetadata(String 
storageId, String resourcePath, String credentialToken) throws Exception {
+    public DirectoryResourceMetadata getDirectoryResourceMetadata(String 
resourceId, String resourcePath, String credentialToken) throws Exception {
         ResourceServiceClient resourceClient = 
ResourceServiceClientBuilder.buildClient(resourceServiceHost, 
resourceServicePort);
-        SCPStorage scpStorage = 
resourceClient.scp().getSCPStorage(SCPStorageGetRequest.newBuilder().setStorageId(storageId).build());
+        SCPResource scpPResource = 
resourceClient.scp().getSCPResource(SCPResourceGetRequest.newBuilder().setResourceId(resourceId).build());
 
         SecretServiceClient secretClient = 
SecretServiceClientBuilder.buildClient(secretServiceHost, secretServicePort);
         SCPSecret scpSecret = 
secretClient.scp().getSCPSecret(SCPSecretGetRequest.newBuilder().setSecretId(credentialToken).build());
 
-
-        SCPResource scpResource = 
SCPResource.newBuilder().setScpStorage(scpStorage)
-                        .setDirectory(DirectoryResource.newBuilder()
-                        .setResourcePath(resourcePath).build()).build();
+        String childPath = 
Paths.get(scpPResource.getDirectory().getResourcePath(), 
resourcePath).toString();

Review comment:
       I discussed with @DImuthuUpe and decided that the childPath should be 
the full path. Actually, the childPath value passed should be the same as the 
resourcePath returned for that resource when the listing was returned for the 
parent.  That is, the API client can call getDirectoryResourceMetadata and take 
the resourcePath for each returned directory and then call 
getDirectoryResourceMetadata with that resourcePath as the childPath value.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to