It's all about the answers!

Ask a question

[Urgent]Fetch the the path of a file at changeset without using the workspace


Fatla 777 (263712) | asked Feb 21 '13, 6:25 a.m.
I need to know the full path of the file at changeset  without the need to create instance of WorkSpaceConnection.

I have finished fetching the files I need at changeset,now I need to know the full path of this FileItem.

IFileItem fileItem = (IFileItem) vm.fetchCompleteState(after, null);

I have searched & posted at the forum and most of things I found is that I can use:
configuration.determineAncestorsInHistory

However in order to get the IConfiguration,I need for workspaceConnection which is not valid at my case.

Can you give me a clue how could if that is applicable and how?

Thanks.

One answer



permanent link
John Riendeau (46626) | answered Feb 21 '13, 9:36 a.m.
JAZZ DEVELOPER
Conceptually, I don't think you can resolve the full path without a connection to a specific workspace or stream.

Consider: a file (foo.txt) might exist in your repository workspace at /myproject1/myfolder/foo.txt.  However, I might have committed a change to *my* repository workspace that moves myfolder (and foo.txt underneath it) to a different project, myproject2, making its full path /myproject2/myfolder/foo.txt.  The exact same file could have different full paths, depending on the context, and neither one is more "correct" than the other.

In the Eclipse client, have you ever opened a change set in the Change Explorer view, only to be presented with some folders marked as <unresolved> and a message like "Some paths could not be resolved. Click here to fix this." (and 'clicking here' brings up a dialog where you can specify a repository workspace or stream to use to resolve the paths)?  If I'm not mistaken, it's the same thing you're running into.  You might want to take a step back and re-examine what you're trying to do, if you finding yourself needing to get a full path without a connection to a repository workspace or stream.



Comments
Fatla 777 commented Feb 21 '13, 9:47 a.m.

Thanks John.
I need to get the latest from the project area at server not from the anyone's workspace to avoid the issue you showed.

Is that possible?
I have set of parameters on my hand and I need to get the full path of the file within this changeset:
-Repository.
-ChangeSet
-Project Area
-FileItem

Thanks.


1
John Riendeau commented Feb 21 '13, 9:57 a.m.
JAZZ DEVELOPER

I think you'd need to fully define what you really mean by "the latest from the project area".  A project area could contain multiple streams that might have the same file at different paths, just as in my example with repository workspaces above.  If so, which one would you use?

If your project area will only ever contain one stream, you could just get a connection to that stream and use it to resolve the path, but that's a pretty big simplifying assumption to make.


1
Tim Mok commented Feb 21 '13, 11:10 a.m.
JAZZ DEVELOPER

John is correct. You'll need the workspace or stream. When you refer to latest in the project area on the server, it has to be in a stream that you consider the latest.


Fatla 777 commented Feb 21 '13, 1:06 p.m. | edited Feb 21 '13, 1:06 p.m.

Initially thanks to you John and Tim.
As I am a newbie to RTC,my 2nd day,I had a misunderstanding at concepts.
Thanks to John who alerted me to those mistakes.

Now I would use the stream as well.
Um looping over my change set,so from the change set,I should know the stream and hence get the full directory of the file.

If you have any tips/snippets  to do it,I would be thankful.


Fatla 777 commented Feb 21 '13, 1:59 p.m.

Is it possible to get the stream name of a changeset !


John Riendeau commented Feb 21 '13, 2:02 p.m.
JAZZ DEVELOPER

No.  Just as a file may exist in zero or more streams, a change set may also have been delivered to zero or more streams.  It doesn't "belong" to any one stream.


Fatla 777 commented Feb 21 '13, 3:19 p.m.

Can you assist me into this:
https://jazz.net/forum/questions/103355/java-get-the-full-path-of-a-file-at-change-set

it may get answered as Tim said but I need to know each part in detail.



showing 5 of 7 show 2 more comments

Your answer


Register or to post your answer.