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:
In RTC 4.0 getRepositoryUri() has been removed from ISharingDescriptor. I can do this:
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
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,
Is there a way to write this code such that it works in both RTC 3.0 and 4.0?
Thanks,
Steve