Welcome to the Jazz Community Forum
How to get unresolved changes of a repository workspace using java API

One answer

boolean uncheckedInChangesExist = false;
IWorkspace workspace = getWorkspace();
if (workspace != null) {
ILocalChangeManager lcm = FileSystemCore.getSharingManager().getLocalChangeManager();
ISharingManager sm = FileSystemCore.getSharingManager();
Collection<ISandbox> sandboxes = sm.getRegisteredSandboxes();
SubMonitor subMonitor = SubMonitor.convert(monitor, sandboxes.size());
outter: for (ISandbox sandbox : sandboxes) {
Collection<? extends IConfigurationDescriptor> loadedComponents = null;
try {
loadedComponents = sandbox.allLoadedConfigurations(subMonitor.newChild(1));
} catch (FileSystemException exception) {
// TODO log exception
}
for (IConfigurationDescriptor loaded : loadedComponents) {
if (loaded.getConnectionHandle() instanceof IWorkspaceHandle) {
IComponentHandle component = loaded.getComponentHandle();
ILocalChange[] localChanges = lcm.getPendingChanges(workspace, component, sandbox);
if (localChanges.length > 0) {
uncheckedInChangesExist = true;
break outter;
}
}
}
}
}
return uncheckedInChangesExist;
}
Comments


Nope, you're not missing anything. Take a look at the Java package that ILocalChangeManager is in, which is: "com.ibm.team.filesystem.client". I.e. all this code is client-side code. The server does not know about these 'unresolved' changes (which is a client-side concept).

I would like to put my question in other way. Do we have any API which gives us the files which are modified and are not yet checked-in.

"Pending local changes" or "Unresolved changes" or "files which are modified and are not yet check-in" are all the same thing. There is the API I mentioned above, but this API is client-side API. The server has no concept of this and thus there is no API on the server.