It's all about the answers!

Ask a question

How can I find the complete path of a resource in repository


Vinod Kumar (9612010) | asked Jan 01 '09, 7:24 a.m.
JAZZ DEVELOPER
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



permanent link
John Camelon (1.7k14) | answered Jan 05 '09, 11:58 a.m.
JAZZ DEVELOPER
vkcind wrote:
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?


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

permanent link
Vinod Kumar (9612010) | answered Jan 05 '09, 5:46 a.m.
JAZZ DEVELOPER
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?

permanent link
John Camelon (1.7k14) | answered Jan 04 '09, 7:48 p.m.
JAZZ DEVELOPER
vkcind wrote:
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?


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

permanent link
Vinod Kumar (9612010) | answered Jan 02 '09, 4:07 a.m.
JAZZ DEVELOPER
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?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.