Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for refactored storages api #28

Merged
merged 4 commits into from
Feb 18, 2021

Conversation

machristie
Copy link
Contributor

No description provided.

`childPath` specified in FetchResourceMetadataRequest should be the
`resourcePath` for child directories as returned for the parent directory.
@machristie
Copy link
Contributor Author

@DImuthuUpe I've added another fix, but I'm not sure if this is right. I know that SCPMetadataCollector.getFileResourceMetadata(String storageId, String resourcePath, String credentialToken) is getting called with the resourceId, not the storageId as the first argument, so I've fixed the implementation to work with that. But I noticed that you recently updated the interface of getFileResourceMetadata to take storageId (was: parentResourceId) as the first argument. So perhaps the bug is really in the code calling getFileResourceMetadata?

@DImuthuUpe
Copy link
Contributor

@machristie This is an intentional change. There are 2 overloaded methods for getDirectoryResourceMetadata

public DirectoryResourceMetadata getDirectoryResourceMetadata(String resourceId, String credentialToken)
public DirectoryResourceMetadata getDirectoryResourceMetadata(String storageId, String resourcePath, String credentialToken)

The first one is when you have a resource registered in the resource service. The second one is when you don't have a resource registered but you need to list files. I came up with the second one to avoid the overhead of registering resources for each storage but I see some possible issues with authorization. Maybe we need to change it back to

public DirectoryResourceMetadata getDirectoryResourceMetadata(String parentResourceId, String resourcePath, String credentialToken)

What do you think?

@machristie
Copy link
Contributor Author

@DImuthuUpe I've switched the methods back to taking a parentResourceId in the latest commit.

@DImuthuUpe DImuthuUpe merged commit 13ff874 into master Feb 18, 2021
@machristie machristie deleted the getChildFileResourceMetadata-fix branch February 23, 2021 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants