Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

download changesets of a workitem via JAVA APIs

Is it possible to download the changesets of a workitem from the RTC server into local PC using java API's ?

0 votes



One answer

Permanent link

Using plain java API, once you got a IChangeSet cs object,

  for (Object o: cs.changes()) {
   IChange change = (IChange) o;

 IVersionableHandle afterHandle = change.afterState();

IVersionable afterVersionable = wm.versionableManager().fetchCompleteState(afterHandle, new SysoutProgressMonitor());

IFileItem fileAfter = (IFileItem) afterVersionable;

string outputDir= "C:/temp";

        PrintWriter afterOnDisk = new PrintWriter(outputDir+"after", "UTF-8");
         String lineAfter;
         InputStream isAfter = contentManager.retrieveContentStream(fileAfter, fileAfter.getContent(), null);
         BufferedReader brAfter = new BufferedReader(new InputStreamReader(isAfter));
      while ((lineAfter = brAfter.readLine()) != null) {
       afterOnDisk.println(lineAfter);
         }
         afterOnDisk.close();

[.....]

}

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Mar 07 '18, 6:57 a.m.

Question was seen: 1,492 times

Last updated: Mar 13 '18, 7:15 a.m.

Confirmation Cancel Confirm