Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



4 answers

Permanent link
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?

0 votes


Permanent link
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

0 votes


Permanent link
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?

0 votes


Permanent link
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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,952

Question asked: Jan 01 '09, 7:24 a.m.

Question was seen: 7,320 times

Last updated: Jan 01 '09, 7:24 a.m.

Confirmation Cancel Confirm