How can I retrieve files from a changeset using the Java API?
I am trying to extract the files of a changeset using the Java API to the filesystem but haven't found a single reference in the forum for doing that. Is the approach supposed to be to load a workspace and then copy out the files from the paths contained in the changeset? Or is there a way to directly extract the files? I seem to remember seeing something about the latter method but I can't find anything.
Any help or suggestions would be greatly appreciated!
Andy
|
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Mar 10 '17, 2:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Mar 10 '17, 2:48 a.m. Here some clues: Getting an IFileItem IChangeSet changeSet = (IChangeSet) changeSetIterator.next(); if (changeSet == null) { // It's possible that we don't have read access to this change // set? continue; } for (IChange change : (List<ichange>) changeSet.changes()) { IVersionableHandle after = change.afterState(); IVersionable item = (IVersionable) scmService.fetchState(after, null, null); if (item instanceof IFileItem) { IFileItem fileItem = (IFileItem) item;Getting the data for an IFileItem is here: http://thescmlounge.blogspot.de/2013/08/getting-your-stuff-using-rtc-sdk-to-zip.html
Some more here: https://jazz.net/forum/questions/161098/how-to-retrieve-file-path-for-iversionable-from-ichangeset-with-ibaselineset-workspace-given
How to get the ISCMService in a Plain Java Client is explained here: https://rsjazz.wordpress.com/2016/02/04/setting-custom-attributes-for-scm-versionables/
Andy Jewell selected this answer as the correct answer
|
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.