How to programatically get the lock status of a file from a stream?
Hi ,
I have prepared a change set with some files and associated that change set to some work item. I have developed a Plugin which will take input of Work Item number and fetch the files inside change set(s) associated to it.
Now to enhance that plugin, I want to display the List of files from change set which are locked by any Team user.
Currently I am using the IsImmutable method of IFileItem class. But there are some refresh problems occurring like even after the user has released / Locked the file, same is not reflecting to my plugin ONLINE.
Is there any direct method to know whether the given file in the Stream was locked by an user or not.
Regards
Pugazh
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.)