It's all about the answers!

Ask a question

How to get the file items from the component's baseline part of a Snapshot programatically ?

Jazzuser user (4827) | asked May 22 '18, 12:38 a.m.
edited Jun 01 '18, 2:41 p.m. by David Lafreniere (4.6k7)

Hello All,

I have a scenario wherein I need to get all the file item versions part of the Component baseline directly instead getting the files from the Changeset.

Why I require this : In a given snapshot, a single file can be part of multiple CSs. I finally need the file versions of that file, part of this snapshot, for my further logics. So if i traverse from CS, i will get the file item, but its version might be one.

Are there any APIs, that I can get the File item information directly from the Component Baseline, instead of going through the CSs and then fetching the files ? OR is there any other way to get all the file versions of a file part of snapshot ?

 Request you to assist on this.

Thank you.

One answer

permanent link
David Lafreniere (4.6k7) | answered Jun 01 '18, 2:40 p.m.
Instead of inspecting the change sets to get the files, you can get the baseline configuration (which is basically the full folder/file tree at the time the baseline was created)
IConfiguration configuration = IBaselineConnection.configuration()
You can then traverse the file tree using:
   configuration.childEntriesForRoot(IProgressMonitor monitor)
and recursive calls of:
   configuration.childEntries(List folderHandles, IProgressMonitor monitor)

Your answer

Register or to post your answer.