It's all about the answers!

Ask a question

Setting workspace configuration based on stream using Java client API (RTC 4.0.3)


Morten Madsen (3053048) | asked Sep 13 '13, 3:34 a.m.
edited Oct 16 '14, 5:47 a.m.
I'm wondering if there's an easy way to make a workspace identical to a stream configuration using the Java Client API?

I guess it must be something like running through all components and do a replace operation and then point to the stream configuration?

One answer



permanent link
Morten Madsen (3053048) | answered Oct 16 '14, 5:44 a.m.
edited Oct 16 '14, 5:46 a.m.
 I guess the easiest way to get around this is to create a new workspace directly from an existing stream:

ITeamRepository repo;

public IWorkspaceConnection createWorkspaceFromStream(IContributorHandle owner, IWorkspaceHandle stream)
{	
  IWorkspaceConnection streamConn = SCMPlatform.getWorkspaceManager(repo).getWorkspaceConnection(stream, monitor);
return SCMPlatform.getWorkspaceManager(repo).createWorkspace(owner, "Workspace1", "This workspace was created automatically", streamConn, streamConn, monitor); }

Your answer


Register or to post your answer.