It's all about the answers!

Ask a question

How to programmatically construct the absolute URI for an object like snapshot?


Arne Bister (2.6k12832) | asked Jul 11 '14, 4:49 p.m.
JAZZ DEVELOPER
Team,
this is a self-answered question.

Problem: Needing to construct a Related Artifact link to the absolute URI of a snapshot.
Given are:
IBaselineSet snapshot
ITeamRepository teamRepository

Needed:
URI snapshotUri

One answer



permanent link
Arne Bister (2.6k12832) | answered Jul 11 '14, 4:52 p.m.
JAZZ DEVELOPER
This code snipped will solve the above scenario:

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

Location location = Location.itemLocation(snapshot, teamRepository.getRepositoryURI());                                         
URI snapURI = location.toAbsoluteUri();

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.