It's all about the answers!

Ask a question

Getting the repository workspace from a file


Daniele Menon (2643) | asked Feb 22 '10, 10:23 a.m.
Hi to all,
given the local path of a file (or folder) under Jazz Source Control, how can I find the name of the repository workspace where it is versioned?

I suppose that if I obtain the IShareable instance I can retrieve all the information from the ISharingDescriptor field of the IShare element. But I'm not able to obtain the IShareable from the local path....

Thanks a lot

Daniele

2 answers



permanent link
Andrew Hoo (1.0k1) | answered Feb 26 '10, 12:08 p.m.
JAZZ DEVELOPER
FileSystemCore.getSharingManager().findShareable(IPath, ResourceType) can
get you an IShareable from a path.

Andrew

On Mon, 22 Feb 2010 10:23:03 -0500, kostja79
<daniele> wrote:

Hi to all,
given the local path of a file (or folder) under Jazz Source Control,
how can I find the name of the repository workspace where it is
versioned?

I suppose that if I obtain the IShareable instance I can retrieve all
the information from the ISharingDescriptor field of the IShare
element. But I'm not able to obtain the IShareable from the local
path....

Thanks a lot

Daniele



--

permanent link
Daniele Menon (2643) | answered Mar 05 '10, 3:59 a.m.
Dear Adhoo,

thank you for your help. However I obtain a null reference instead of an IShareable.

I report my code:
String filename = ...

IPath path = new Path(filename);
TeamPlatform.startup();
FileSystemCore.startUp();
ISharingManager sm = FileSystemCore.getSharingManager();
IShareable shareable = sm.findShareable(path, true);


Moreover, if I apply sm.allShares(monitor), I obtain an empty array.

Probably I am using the FileSystemCore in an uncorrect way... where is the problem?

Thanks

FileSystemCore.getSharingManager().findShareable(IPath, ResourceType) can
get you an IShareable from a path.

Andrew

On Mon, 22 Feb 2010 10:23:03 -0500, kostja79
<daniele> wrote:

Hi to all,
given the local path of a file (or folder) under Jazz Source Control,
how can I find the name of the repository workspace where it is
versioned?

I suppose that if I obtain the IShareable instance I can retrieve all
the information from the ISharingDescriptor field of the IShare
element. But I'm not able to obtain the IShareable from the local
path....

Thanks a lot

Daniele



--

		                                        

Your answer


Register or to post your answer.