It's all about the answers!

Ask a question

how to fetch relative path of a file item/ versionable?


akshay p (15119) | asked Feb 21 '19, 12:25 a.m.
edited Feb 21 '19, 6:40 a.m. by Ralph Schoon (63.6k33646)

how to fetch relative path of a file item/ versionable?

2 answers



permanent link
Ralph Schoon (63.6k33646) | answered Feb 21 '19, 6:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Maybe check this: http://thescmlounge.blogspot.com/2013/08/getting-your-stuff-using-rtc-sdk-to-zip.html


And please use reasonable tagging. This is rational team concert extending and noting else.


permanent link
David Lafreniere (4.8k7) | answered Feb 21 '19, 12:40 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
You can use:

IScmService.configurationLocateAncestors(...)

or

IScmService.configurationDetermineAncestorsInHistory(...)  (this will give you the path of a file even if it was recently deleted in the stream - it goes through the change set history to try to find the path where the file used to be).


Comments
akshay p commented Feb 26 '19, 6:19 a.m.

i have only iversionable and ifileitem as inputs, how to fetch in that case.


David Lafreniere commented Feb 26 '19, 9:06 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
You will not be able to retrieve a path given a versionable on its own. A file has a pointer to the parent folder (where the pointer is just an itemId or handle), but the name of that parent folder (along with the full path right up to the component root) can only be determined with a context (stream/workspace/baseline).

For example, 'fileA.txt' may be located at '/dirA/dirA2/fileA.txt' in StreamA, and '/dirB/dirB2/dirB3/fileA.txt' in StreamB.

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.