How to access change set file information
![](http://jazz.net/_images/myphoto/3795e33ff2464384809c70d4ea93c61c.jpg)
2 answers
![](http://jazz.net/_images/myphoto/3795e33ff2464384809c70d4ea93c61c.jpg)
![](http://jazz.net/_images/myphoto/3795e33ff2464384809c70d4ea93c61c.jpg)
public static void main(ITeamRepository repo) throws Exception {
IWorkspaceManager wsmgr = SCMPlatform.getWorkspaceManager(repo);
IItemManager imgr = (IItemManager) repo.getClientLibrary(IItemManager.class);
IVersionableManager vmgr = (IVersionableManager) repo.getClientLibrary(IVersionableManager.class);
IChangeSetSearchCriteria criteria = IChangeSetSearchCriteria.FACTORY.newInstance();
// TODO set the cs search criteria
List<IChangeSetHandle> list = wsmgr.findChangeSets(criteria, 100, null);
for (IChangeSetHandle handle : list) {
IChangeSet cs = (IChangeSet) imgr.fetchCompleteState(handle, null);
IContributorHandle authorHandle = cs.getAuthor();
IContributor author = (IContributor) imgr.fetchCompleteState(authorHandle, null);
// TODO do something with the author
List<IChange> changes = cs.changes();
for (IChange change : changes) {
IVersionableHandle beforeHandle = change.beforeState();
IVersionable before = vmgr.fetchCompleteState(beforeHandle, null);
// TODO do something with the before state
IVersionableHandle afterHandle = change.afterState();
IVersionable after = vmgr.fetchCompleteState(afterHandle, null);
// TODO do something with the after state
}
}
}