It's all about the answers!

Ask a question

How to create ILocation?


Jeff Care (1.0k3633) | asked Mar 23 '11, 2:00 p.m.
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.

Accepted answer


permanent link
Ulf Arne Bister (1.3k112) | answered Apr 06 '18, 3:54 a.m.

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

6 other answers



permanent link
Jeff Care (1.0k3633) | answered Mar 29 '11, 11:37 a.m.
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.

permanent link
Ralph Schoon (60.5k33643) | answered Apr 04 '11, 5:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

permanent link
Jeff Care (1.0k3633) | answered Apr 04 '11, 8:06 a.m.
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

permanent link
Ralph Schoon (60.5k33643) | answered Apr 04 '11, 8:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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

permanent link
Jeff Care (1.0k3633) | answered Apr 04 '11, 8:38 a.m.
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?

permanent link
Ralph Schoon (60.5k33643) | answered Apr 04 '11, 10:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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?

Your answer


Register or to post your answer.