machristie commented on a change in pull request #28:
URL: https://github.com/apache/airavata-mft/pull/28#discussion_r568941520
##########
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:
@DImuthuUpe I wasn't sure how childPath should be used. I assumed that
it would be concatenated with the scp resource's resourcePath. For example, if
the scp resource has resourcePath `/tmp` and the childPath for the
FetchResourceMetadataRequest is `test`, then I would expect that these would be
concatenated and the result would be metadata for the directory `/tmp/test`, so
that's what I implemented. But let me know if I got the idea wrong.
----------------------------------------------------------------
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]