How can i get the "my repository workspace" programmatically with plain java API
I am able to find the project area,stream and component with the help of IWorkspaceManager but not able to find the my repository workspace.
I have to do few operation with the following parameters ITeamRepository repo, IWorkspaceHandle workspace, IComponentHandle component, String sandboxLocation_CanBeNullIfRunningFromWithinEclipseRTC |
One answer
You will need to search for your workspace.
IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(repository)
IWorkspaceSearchCriteria criteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
criteria.setExactName(rtcWorkspace); // or use another criteria
criteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
List<IWorkspaceHandle> workspaces = wm.findWorkspaces(criteria, maxSize, minitor);
IWorkspaceConnection connection = wm.getWorkspaceConnection(workspaces.get(0), monitor);
Comments
vikas v
commented May 15 '15, 12:35 a.m.
i done in the same way but after getting workspace connection when i am calling new function with the following parameter
What function are you calling after getting WorkspaceConnection ?
vikas v
commented May 18 '15, 5:49 a.m.
It is not a generic method, it was provided by ibm for my organization.
Surya Tripathi
commented May 18 '15, 1:50 p.m.
ISharingManager sharingManager = FileSystemCore.getSharingManager();
File workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
PathLocation pathlocation = new PathLocation(workspaceRoot.getAbsolutePath());
ILocation sandBoxLocation = pathlocation.getCanonicalForm();
ISandbox sandbox = sharingManager.getSandbox(sandBoxLocation, false);
LoadDilemmaHandler p = LoadDilemmaHandler.getDefault();
IRelativeLocation relativeLocation = new RelativeLocation(new String[0]);
ILoadOperation loadOp = IOperationFactory.instance.getLoadOperation(p);
loadOp.requestLoad(sandbox, relativeLoadPath, workspaceConnection, componentHandle, Collection<? extends IVersionableHandle> itemsToLoad);
You can also use loadrule to load your workspace -
loadOp.requestLoad(ISandbox sandbox, IRelativeLocation relativeLoadPath, Collection<ILoadRule> loadRules, monitor)
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.