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

Get the repository URI for an IResource

I have an IResource and I would like to get the repository URI associated with this IResource.

In RTC 3.0 I can do this:

IShareable shareable = (IShareable) resource.getAdapter(IShareable.class);
ISharingDescriptor sd = shareable.getShare(new NullProgressMonitor()).getSharingDescriptor();
String repositoryURI = sd.getRepositoryUri();


In RTC 4.0 getRepositoryUri() has been removed from ISharingDescriptor. I can do this:

IShareable shareable = (IShareable) resource.getAdapter(IShareable.class);
ISharingDescriptor sd = shareable.getShare(new NullProgressMonitor()).getSharingDescriptor();
UUID repositoryId = sd.getRepositoryId();
ITeamRepository teamRepository = TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryId);
String repositoryURI = teamRepository.getRepositoryURI();


But, in RTC 3.0, TeamPlatform.getTeamRepositoryService().getTeamRepository() can not take a UUID, it only takes a String.

Is there a way to write this code such that it works in both RTC 3.0 and 4.0?

Thanks,
Steve

0 votes


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: May 07 '12, 3:06 p.m.

Question was seen: 3,627 times

Last updated: Aug 01 '17, 1:46 a.m.

Confirmation Cancel Confirm