How can I find the complete path of a resource in repository
![]()
How can I find the complete path of a resource(file/folder) in repository?
I'm follow the procedure below: List<IAncestorReport> ancestors = IConfiguration.locateAncestors(versionableHandles, null); for (IAncestorReport report : ancestors){ List<INameItemPair> nameItemPairs = report.getNameItemPairs(); and from INameItemPair, I construct the path. Is it the right way or there is some more efficinet way to achieve this? Moreoever if the file is deleted from the repository workspace, this method does not work, I always get null path in this case. So if the file is deleted from the repository workspace, how can I construct the path for this deleted file. |
4 answers
![]()
How can I find the complete path of a resource(file/folder) in repository?
I'm follow the procedure below: List<IAncestorReport> ancestors = IConfiguration.locateAncestors(versionableHandles, null); for (IAncestorReport report : ancestors){ List<INameItemPair> nameItemPairs = report.getNameItemPairs(); and from INameItemPair, I construct the path. Is it the right way or there is some more efficinet way to achieve this? Moreoever if the file is deleted from the repository workspace, this method does not work, I always get null path in this case. So if the file is deleted from the repository workspace, how can I construct the path for this deleted file. Also if the file is renamed and/or reparented then how can I find the previous and current path of the file? |
![]()
vkcind wrote:
How can I find the complete path of a resource(file/folder) in The path for locateAncestors() is that which would be current in that specific configuration. IConfiguration#determineAncestorsInHistory() can be used to approximate a path should the item not be present in the repository. HTH, JohnC SCM Server |
![]()
Hi,
Thanks for the reply. I'm able to get the deleted file path using IConfiguration#determineAncestorsInHistory() But still facing problem in getting the complete path for a renamed and/or reparented. In this case IConfiguration#determineAncestorsInHistory() gives me the current path but not previous path of the file? |
![]()
vkcind wrote:
Hi, You could find a previous baseline for the workspace and ask it what the previous path was. Otherwise you will need to do the same thing the jazz SCM server is doing: to go back over the file history and reinterpret what the path could be. Why are you concerned about the old path? JohnC |