It's all about the answers!

Ask a question

Getting List of all files in the workspace


Alan King Lun Lai (263) | asked Jan 28 '09, 5:32 a.m.
I think I can do this by

going through

all the changeSets by

"SCMPlatform.getWorkspaceManager(repo).findChangeSets()"

and adding the files to a set one by one.


Is there any efficient API for achieving this?

Thanks~

One answer



permanent link
John Camelon (1.7k14) | answered Jan 29 '09, 12:23 a.m.
JAZZ DEVELOPER
f9s4 wrote:
I think I can do this by

going through

all the changeSets by

"SCMPlatform.getWorkspaceManager(repo).findChangeSets()"

and adding the files to a set one by one.


Is there any efficient API for achieving this?

Thanks~


1. Given a workspace handle, you can get a connection to the workspace
via IWorkspaceManager.

2. With a workspace connection, you can iterate over all components via
getComponents().

3. For each component, you can visit each configuration via
IWorkspaceConnection#configuration(componentHandle).

4. For each IConfiguration, you can get children from the root folder
by using childEntriesForRoot(). This will list off folder and files.

5. For every folder, you can recurse and call
IConfiguration#childEntries() on it.

HTH,
JohnC
SCM Server

Comments
SEC Servizi commented Feb 15 '13, 5:49 a.m. | edited Feb 15 '13, 6:34 a.m.
Hi John,

the IConfiguration#childEntriesForRoot().values() returns a void collection if we don't call first ISandbox#allShares().

Do you know why (e.g., a bug)? Thanks in advance.

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.