How do I retrieve a user's repository workspace?
Can any one suggest me, how we can retrieve the user's repository using plain java api.
All the materials i went through provides solution to fetch the stream/workspace inside the Project area. but i have a requirement which needs me to fetch the users repository workspace. so i can get the flow target of the user repository and enable or disable actions based on the flow target.
Thanks in advance.
Accepted answer
If you know the name of the repository workspace:
String workspaceName = ...you can find it as:
ITeamRepository repo = ...
IWorkspaceSearchCriteria criteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
criteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
criteria.setExactName(workspaceName);
List<IWorkspaceHandle> workspaces = SCMPlatform.getWorkspaceManager(repo).findWorkspaces(criteria, IWorkspaceManager.MAX_QUERY_SIZE , null);
IWorkspaceHandle wksH = workspaces.get(0);
Cheers.