Get IWorkspaceConnection from IVersionable
Hi,
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:
https://www.ibm.com/developerworks/community/blogs/7685ca43-63d4-4946-89fd-58d379a896d1/entry/how_to_read_and_write_a_file_in_the_repository_directly_without_having_to_create_a_workspace?lang=en
public static void applyLock(ITeamRepository repo,
IWorkspaceConnection streamConnection,
IComponentHandle componentHandle, IFileItem fileItem,
IProgressMonitor monitor) throws TeamRepositoryException {
IWorkspaceManager wsManager = (IWorkspaceManager) repo
.getClientLibrary(IWorkspaceManager.class);
IVersionableLockOperationFactory lockFactory = wsManager
.lockOperationFactory();
ArrayList<IVersionableLockOperation> lockOperations = new ArrayList<IVersionableLockOperation>();
lockOperations.add(lockFactory.acquire(fileItem, streamConnection,
componentHandle));
wsManager.applyLockOperations(lockOperations, monitor);
}//applyLock
I have the componentHandle and the fileItem but I cannot figure out how to get the streamConnection. Do you have any idea?
Regards,
Francisco R.
|
Be the first one to answer this question!
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.
Comments
I don't see away to go back up the tree of objects to the stream.
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?
still don't see a way back up the tree.. sorry