It's all about the answers!

Ask a question

Get IWorkspaceConnection from IVersionable

Francisco Rodriguez (561028) | asked Oct 23 '15, 2:06 p.m.
edited Oct 23 '15, 4:38 p.m.

I'm currently trying to get the stream connection from a file in a change set. I am trying to use the following method I found in this article:

public static void applyLock(ITeamRepository repo,
IWorkspaceConnection streamConnection,
IComponentHandle componentHandle, IFileItem fileItem,
IProgressMonitor monitor) throws TeamRepositoryException {
IWorkspaceManager wsManager = (IWorkspaceManager) repo
IVersionableLockOperationFactory lockFactory = wsManager
ArrayList<IVersionableLockOperation> lockOperations = new ArrayList<IVersionableLockOperation>();
lockOperations.add(lockFactory.acquire(fileItem, streamConnection,
wsManager.applyLockOperations(lockOperations, monitor);

I have the componentHandle and the fileItem but I cannot figure out how to get the streamConnection. Do you have any idea?

Francisco R.

sam detweiler commented Oct 23 '15, 2:22 p.m.

I don't see  away to go back up the tree of objects to the stream.

Francisco Rodriguez commented Oct 23 '15, 4:37 p.m.

 Thanks for your quick reply, Sam. I edited the question so you can understand what I am trying to do. Do you have any suggestion?

sam detweiler commented Oct 23 '15, 5:03 p.m.

still don't see a way back up the tree.. sorry

Be the first one to answer this question!

Register or to post your answer.