SCM Findworkspacebyname Functionality
Hello Team,
we have logic to search Workspace by name.
We have below method used for this purpose,
@Deprecated IItemQueryPage findWorkspacesByName(java.lang.String namePattern, boolean matchWorkspaces, boolean matchStreams, boolean matchOwners, int pageSize, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws TeamRepositoryException
One answer
You should be using IWorkspaceManager#findWorkspaces() instead as IWorkspaceManager#findWorkspacesByName() is deprecated.
This API takes in a IWorkspaceSearchCriteria. So, if you want to find workspaces with an exact name for example, you would use: IWorkspaceSearchCriteria.setExactName().
You would need to run this as a user who is an adminstrator, otherwise repository workspaces or streams might be private (inaccessible) to the logged in user.