how get Full path of the File from changeset Using API?
I m able to get the name of the file attached with the change set. But not able to get the API to get the Folder path of the file system.
for (IChangeSet changeset : changesets) { System.out.println("Change Set ITEM_ID_PROPERTY " + changeset.getItemId()); List changes = changeset.changes(); for(Object change : changes) { Change aChange = (Change)change; if(aChange.item() instanceof IFileItemHandle) { IFileItemHandle fileItemHandle = (IFileItemHandle)aChange.afterState(); IFileItem fileItem = (IFileItem)SCMPlatform.getWorkspaceManager(clientUtil.getTeamRepository()).versionableManager().fetchCompleteState(fileItemHandle,null); System.out.println("File Name :"+fileItem.getName()); } } What my approach is to create an text file that can be used for Load rule file for the SCM CLI. I wan to create this file using the API so that I can access the remote workspace. |
3 answers
Ralph Schoon (63.6k●3●36●46)
| answered Nov 09 '12, 6:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There are several similar recent questions with answers in the forum. Does any of them help?
Comments https://jazz.net/forum/questions/8704/is-it-possible-to-get-the-full-path-name-of-a-ifileitem
Fatla 777
commented Feb 20 '13, 2:14 p.m.
I tried to use the same technique.However, I couldn't find a method
1
IWorkspaceConnection isn't the same type returned by your call to get the workspace manager. You can use the workspace manager to get the IWorkspaceConnection though.
Fatla 777
commented Feb 20 '13, 5:26 p.m.
Sorry for this naive mistake.
Fatla 777
commented Feb 20 '13, 5:39 p.m.
My updated code:
|
This is how you find the path:
Notice that versionableHandles is a List of versionableHandle, which mean that it will return a List of IAncestorReport corresponding to the versionableHandles.
That's it.
|
Cool. This works. But for fetching the paths of a lot of change set files belonging to a list of work items, this approach is very slow. It takes about 30 mins to retrieve paths of all the change sets for a single work item. |
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.