How to programmatically(Plain Java) create repository workspace for the specified changeset?
I want to create a repository workspace programmatically in order to get the file of the specified changeset.
So, How I get the new workspace's IWorkspaceConnection?
I use the follow code,could create workspace.
But the baseline of workspace's component is initial baseline, so the content is empty.
String StrChangeSetUUID = "_r7455343xMsxIDwg";
IChangeSetHandle csHandle = (IChangeSetHandle) IChangeSet.ITEM_TYPE.createItemHandle(uuid, null);
IChangeSet changeSet = (IChangeSet) repo.itemManager().fetchCompleteItem(csHandle, IItemManager.DEFAULT, null);
IComponentHandle componentHandle = changeSet.getComponent();
IWorkspaceConnection workspaceConnection = null;
try
{
// How to programmatically create repository workspace for the specified changeset?
workspaceConnection = wm.createWorkspace(repo.loggedInContributor(), "Automatic created WM", "Description", monitor);
workspaceConnection.addComponent(componentHandle, false, monitor);
}
catch (TeamRepositoryException e)
{
e.printStackTrace();
}