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

How to create ILocation?

How does one create an instance of ILocation? The only implementation I could find of this interface is com.ibm.team.filesystem.client.internal.PathLocation which is obviously meant to be internal.

0 votes


Accepted answer

Permanent link

Just as future reference the code needed is mentioned in https://jazz.net/forum/questions/158130/how-to-programmatically-construct-the-absolute-uri-for-an-object-like-snapshot :

import com.ibm.team.repository.common.Location;

Location location = Location.itemLocation(someJazzArtefactObject, teamRepository.getRepositoryURI());                                         
URI myURI = location.toAbsoluteUri();

Ralph Schoon selected this answer as the correct answer

0 votes


6 other answers

Permanent link
Still waiting for an answer on this one, and I'm having a similar problem with IRelativeLocation.

How does one create an instance of ILocation? The only implementation I could find of this interface is com.ibm.team.filesystem.client.internal.PathLocation which is obviously meant to be internal.

0 votes


Permanent link
Hi,

ILocation is implemented by PathLocation. There are numerous references to ILocation in the SDK (I had to create a plugin project and add com.ibm.team.* to the dependencies however to find them).

One code snippet I found was:

public IShareable findShareable(String path) throws FileSystemException {
// Canonicalize the item
ILocation absolute = SubcommandUtil.makeAbsolutePath(config, path);


Why do you want to create one? What do you want to achieve?

Thanks,

Ralph


How does one create an instance of ILocation? The only implementation I could find of this interface is com.ibm.team.filesystem.client.internal.PathLocation which is obviously meant to be internal.

0 votes


Permanent link
We are writing our own build engine implementation, so we have to load the source from RTC. To load the source we're using ILoadOperation, which requires an ISandbox. To get/create a sandbox we're using com.ibm.team.filesystem.client.ISharingManager.getSandbox(ILocation, boolean), which requires ILocation as a parameter.

I had already found com.ibm.team.filesystem.client.internal.PathLocation, and my code is working. But com.ibm.team.filesystem.client.internal.PathLocation is not meant to be exposed externally, as evidenced by this compiler warning:

Discouraged access: The type PathLocation is not accessible due to restriction on required library C:\Program Files\IBM\RTC-SDK-3.0\plugins\com.ibm.team.filesystem.client_2.1.0.v20101110_2353.jar

0 votes


Permanent link
Hi Jeff,

agreed with the compiler warning.

I am just wondering, wouldn't it be easier to use the SCM tool and call that instead of recoding all the load manually?

Thanks,

Ralph

We am writing our own build engine implementation, so we have to load the source from RTC. To load the source we're using ILoadOperation, which requires an ISandbox. To get/create a sandbox we're using com.ibm.team.filesystem.client.ISharingManager.getSandbox(ILocation, boolean), which requires ILocation as a parameter.

I had already found com.ibm.team.filesystem.client.internal.PathLocation, and my code is working. But com.ibm.team.filesystem.client.internal.PathLocation is not meant to be exposed externally, as evidenced by this compiler warning:

Discouraged access: The type PathLocation is not accessible due to restriction on required library C:\Program Files\IBM\RTC-SDK-3.0\plugins\com.ibm.team.filesystem.client_2.1.0.v20101110_2353.jar

0 votes


Permanent link
The short answer is no: it wouldn't be easier. We experimented with the SCM command line and couldn't make it do all the things we needed it to do.

But that's besides the point, really. The fact is that RTC presents public APIs that expect certain parameters types that, as far as I can tell, are impossible to create without violating package access contraints.

I am just wondering, wouldn't it be easier to use the SCM tool and call that instead of recoding all the load manually?

0 votes


Permanent link
Jeff,

I found 1400 hits for ILocation in the SDK. I did not review all. The one above is public.

Ralph

The short answer is no: it wouldn't be easier. We experimented with the SCM command line and couldn't make it do all the things we needed it to do.

But that's besides the point, really. The fact is that RTC presents public APIs that expect certain parameters types that, as far as I can tell, are impossible to create without violating package access contraints.

I am just wondering, wouldn't it be easier to use the SCM tool and call that instead of recoding all the load manually?

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

Question asked: Mar 23 '11, 2:00 p.m.

Question was seen: 7,037 times

Last updated: Apr 06 '18, 3:54 a.m.

Confirmation Cancel Confirm