How to programatically get the lock status of a file from a stream?
pugazhenthi samidurai (264●2●39●42)
| asked Feb 21 '13, 3:59 a.m.
edited Oct 05 '17, 11:15 p.m. by David Lafreniere (4.8k●7) Hi ,
|
Accepted answer
SCMPlatform#getWorkspaceManager() will get you an IWorkspaceManager. IWorkspaceManager#findLocks() should let you search for locks in a stream. It takes an ILockSearchCriteria that you can customize to return exactly the locks you want. (Use ILockSearchCriteria.LockSearchCriteriaFactory#newInstance() to create the ILockSearchCriteria.)
David Lafreniere selected this answer as the correct answer
Comments Hi John.
I don't see anything obviously wrong with the way you're constructing your search criteria. Maybe there's an issue with the code that's interpreting the results you're getting back? Or (and sorry in advance for the stupid question) is it at all possible that the file actually is locked? If you go to your project area in the web UI and choose Source Control --> Locks, do any locks appear?
John has the correct answer here. Please raise a defect if something is not working as expected.
|
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.