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

Getting the repository workspace from a file

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

0 votes



2 answers

Permanent link
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



--

0 votes


Permanent link
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



--

									

0 votes

Your answer

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,927

Question asked: Feb 22 '10, 10:23 a.m.

Question was seen: 4,621 times

Last updated: Feb 22 '10, 10:23 a.m.

Confirmation Cancel Confirm