Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Getting List of all files in the workspace

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~

0 votes



One answer

Permanent link
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

0 votes

Comments
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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 11,008

Question asked: Jan 28 '09, 5:32 a.m.

Question was seen: 7,224 times

Last updated: Feb 15 '13, 6:34 a.m.

Confirmation Cancel Confirm