It's all about the answers!

Ask a question

RTC Api - Remote Path of file


Michael Ron (303) | asked Oct 19 '17, 1:22 a.m.

Hello, how can I Receive remote path of selected file using RTC Api? I have IShareable object and IFile also, but don't know how to receive remote path of it.

2 answers



permanent link
Ralph Schoon (60.5k33643) | answered Oct 19 '17, 3:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Comments
Michael Ron commented Oct 19 '17, 3:22 a.m.

I'm searching remote path not relative. I was able to establish that such information is available in file property -> Jazz Source Control -> and there is remote path field, nevertheless I can't find way to get it from RTC Api.


Geoffrey Clemm commented Oct 19 '17, 3:50 a.m. | edited Oct 19 '17, 4:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note that relative path is a computed value, that requires a "configuration" (stream, workspace, baseline, or snapshot) parameter, and so cannot be determined just from the file itself, and therefore only appears to be a property of the file ... it actually is a computation that requires the configuration parameter.


Ralph Schoon commented Oct 19 '17, 3:57 a.m. | edited Oct 19 '17, 4:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As an example the remote path is

/JKEBusinessData/src/com/jke/beans/AccountBean.java

It is composed of the relative path build by the relative folder information the SCM system stores. Suggestions

  1. Don't assume if it is shown in the properties that there must be a simple getter for it
  2. Consider looking into the links provided to you (e.g. the http://thescmlounge.blogspot.de/2013/08/getting-your-stuff-using-rtc-sdk-to-zip.html computes the relative path in the zip file based on this information


 


Michael Ron commented Oct 19 '17, 5:53 a.m.

Hm... remote path looks like following: component/path/to/file, since relative path in my workarea is different, because of particular loadrule. I thought remote path should be available through some class or getter... I guess need to go through all component folders and check if such file exist there.. don't think that this is most elegant solution.


Ralph Schoon commented Oct 19 '17, 6:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Maybe there is a mechanism to search for a file in the API? I am almost sure there is.
Or consider looking into the links I provided, these however assume the basic structure of Eclipse projects in SCM.


Michael Ron commented Oct 19 '17, 8:32 a.m.

It really doesn't have sense, since I have IShare object which is linked with component which contain the file, and I'm able to get this componen but I'm not able to get remote path of this file in this component...


Ralph Schoon commented Oct 19 '17, 8:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Never mind. Good luck with your automation then.

showing 5 of 7 show 2 more comments

permanent link
Steven Hovater (808) | answered Oct 19 '17, 9:38 a.m.

 If you have the shareable, you can get the local path:

ILocation fullpath = shareable.getFullPath();

do you need the "remote path" ?


Comments
Michael Ron commented Oct 19 '17, 12:39 p.m.

Yes I need remote path, which represents how file is stored in server. Function getFullPath gives me absolute path to the file but from my workspace which is not what I need.


Michael Ron commented Oct 19 '17, 12:41 p.m.

I'm still trying to get it, but without any hint it's really hard...


Steven Hovater commented Oct 19 '17, 1:01 p.m.

 I was under the impression that files were stored in blobs in the database.. 


Steve


Geoffrey Clemm commented Oct 19 '17, 5:03 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 File (versions) are blobs in the database, but in the context of a given configuration (workspace, stream, baseline, snapshot), the RTC server can compute a remote pathname for that file wrt that configuration.


Michael Ron commented Oct 20 '17, 1:06 a.m.

Do you know what function in RTC Api can compute remote pathname of base of eg. workspace?

Your answer


Register or to post your answer.