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
![]() 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. |
![]()
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.
|
![]()
Ralph Schoon (61.8k●3●36●43)
| 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
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.
Sorry for this naive mistake.
My updated code:
|