download changesets of a workitem via JAVA APIs
One answer
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();
[.....]
}