Fetching snapshot from BuildResult
In RTC client someone could download the snapshot generated by the Build in the BuildResult page (there is a link to lead you to the snapshot).
Accepted answer
Here is how you retrieve the snapshot (IBaselineSetHandle) associated with a build result using the client-side Java API. (Note: I am assuming you already know the code used to fetch the full IBaselineSet from the IBaselineSetHandle):
...
IBuildResultHandle buildResultHandle = getBuildResultHandle(); // This can be 'any' build result or 'release'
IBaselineSetHandle snapshotHandle = null;
ITeamBuildClient client = (ITeamBuildClient) getRepository().getClientLibrary(ITeamBuildClient.class);
IBuildResultContribution[] contribution = client.getBuildResultContributions(buildResultHandle ,
new String[] { ScmConstants.EXTENDED_DATA_TYPE_ID_BUILD_SNAPSHOT }, monitor);
if (contribution.length > 0) { // It's possible for a build to NOT have a snapshot contribution
snapshotHandle = (IBaselineSetHandle) contribution[0].getExtendedContribution();
}
...
2 other answers
Comments
Is there any opportunity to fetch a snapshot from a release via java plain api?