It's all about the answers!

Ask a question

how to convert IVersionable to IShareable/IResource


Jingwen Ou (5610) | asked Aug 06 '08, 9:34 p.m.
hi,

I get a list of IVersionable from the repository and would like to get their corresponding local information like the IPath of a resource, etc. One way might be to get their IShareable/IResource. But it seems we couldn't not simply adapt back to them.

What is a decent way to get the local information such as local IPath from a IVersionable?

Thanks for any info,
Owen

One answer



permanent link
Heather Fraser-Dube (4512) | answered Aug 08 '08, 12:54 p.m.
JAZZ DEVELOPER
jingweno wrote:
hi,

I get a list of IVersionable from the repository and would like to get
their corresponding local information like the IPath of a resource,
etc. One way might be to get their IShareable/IResource. But it seems
we couldn't not simply adapt back to them.

What is a decent way to get the local information such as local IPath
from a IVersionable?

Thanks for any info,
Owen


ISharingManager sm = FileSystemCore.getSharingManager()
IShareable shareable = sm.findShareable(cfaRoot, versionableHandle,
componentHandle, contextHandle, progressMonitor);

cfaRoot is the root of the copy file area, if you are using eclipse then
you can easily get it from ISharingManager.getDefaultCFARoot()

IPath localPath = shareable.getLocalFullPath();

Your answer


Register or to post your answer.