Given a Stream name, Get all the files available in the Components using API
One answer
The snippets that come with the Plain Java Client Libraries has some content about SCM.
https://github.com/jazz-community/ewm-scm-utils has commands, that do exactly what you require. The code is available. All require the EWM SDK to be set up to develop.