It's all about the answers!

Ask a question

How do I get the list of repository files (not folders) of the component programmatically?

Janani Vinayagam (11) | asked Oct 15 '19, 1:31 a.m.

 I need to get all files that are part of component. Incase the component is having multiple folders, the code needs to iteratre through all folders and it needs to give only file items.

One answer

permanent link
Ian Wark (79713450) | answered Oct 15 '19, 1:43 a.m.
I notice that a similar question has been asked before. It seems to show how to iterate over folders to obtain the file items. Does this help?

Janani Vinayagam commented Oct 15 '19, 1:57 a.m.

Hi Thanks for your reply. I have tried that solution. In my case I have multiple folders in my component(Folders inside folders I am having). With that solution I need to iterate multiple times. Example, I will get one child folder, that will be having one file and 2 folders, again i need to get into that folders and iterate. It will keep on go like this. So I am looking for some other solution.

Ian Wark commented Oct 15 '19, 3:54 a.m. | edited Oct 15 '19, 3:57 a.m.

When you say you wish to get the files, do you want to download them? There is an example here which uses the loadDirectory() method.

Your answer

Register or to post your answer.