Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes

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


Be the first one to answer this question!

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Oct 23 '15, 2:06 p.m.

Question was seen: 1,983 times

Last updated: Oct 23 '15, 5:03 p.m.

Confirmation Cancel Confirm