It's all about the answers!

Ask a question

SCM properties of a file


Jeremy Hughes (2164837) | asked Nov 05 '08, 8:38 a.m.
Hi, I'm trying to get (java) programmatic access to the properties of a
file in SCM - i.e. what you see when you do right
click->properties->Jazz Source Control. In particular, the Jazz
Repository URI.

Is this possible via an API? If no API, then perhaps an unsupported way
of doing it.

Thanks,
Jeremy

5 answers



permanent link
Dmitry Karasik (1.8k11) | answered Nov 05 '08, 8:38 a.m.
JAZZ DEVELOPER
Hi, I'm trying to get (java) programmatic access to the properties of a
file in SCM - i.e. what you see when you do right
click->properties->Jazz Source Control. In particular, the Jazz
Repository URI.


I assume you have the IResource that corresponds to the file. Then you do:

((IShareable)resource.getAdapter(IShareable.class)).getShare
().getSharingDesciptor().getRepositoryUri()

- Dmitry

permanent link
Dmitry Karasik (1.8k11) | answered Nov 05 '08, 9:13 a.m.
JAZZ DEVELOPER
Thanks for the quick response, but I'm a newb to jazz.extend. How do I
get an IResource to a file?

IResource is an eclipse concept. What object do you have to start with
that you want to get the properties for?

- Dmitry

permanent link
Jeremy Hughes (2164837) | answered Nov 05 '08, 12:08 p.m.
On 05/11/2008 13:36, Dmitry Karasik wrote:
Hi, I'm trying to get (java) programmatic access to the properties of a
file in SCM - i.e. what you see when you do right
click->properties->Jazz Source Control. In particular, the Jazz
Repository URI.


I assume you have the IResource that corresponds to the file. Then you do:

((IShareable)resource.getAdapter(IShareable.class)).getShare
().getSharingDesciptor().getRepositoryUri()

- Dmitry
Thanks for the quick response, but I'm a newb to jazz.extend. How do I

get an IResource to a file?

Thanks,
Jeremy

permanent link
Jeremy Hughes (2164837) | answered Nov 05 '08, 3:18 p.m.
On 05/11/2008 18:13, Dmitry Karasik wrote:
Thanks for the quick response, but I'm a newb to jazz.extend. How do I
get an IResource to a file?

IResource is an eclipse concept. What object do you have to start with
that you want to get the properties for?

- Dmitry

I wasn't sure whether you meant the IResource in Eclipse or the one in
com.ibm.team.repository.common.

I'd prefer to start with a File object, keeping the number of extra jars
on the classpath to a minimum - I'll be coding this in an Ant task and
potentially running outside Eclipse. Having said that I don't know the
extent of jars I'll need from Team Concert and whether those depend on
Eclipse.

Thanks,
Jeremy

permanent link
Dmitry Karasik (1.8k11) | answered Nov 06 '08, 6:02 a.m.
JAZZ DEVELOPER
I wasn't sure whether you meant the IResource in Eclipse or the one in
com.ibm.team.repository.common.

I meant the one in eclipse.

I'd prefer to start with a File object, keeping the number of extra jars
on the classpath to a minimum - I'll be coding this in an Ant task and
potentially running outside Eclipse. Having said that I don't know the
extent of jars I'll need from Team Concert and whether those depend on
Eclipse.

If you run outside eclipse then you need to have 2 things, a copy file
area root and a path relative to the copy file area root. Then you can
call

FileSystemCore.getSharingManager().findShareable(cfaPath,
filePathRelativeToCFA, !file.isFile()).getShare().getSharingDescriptor
().getRepositoryUri()

- Dmitry

Your answer


Register or 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.