how to list directories in Flow-Service?

Hi all!

How can i list folders of a directory? I want something like listFiles, but for directories?

Must is wrote my own Java-Service todo so?


Yes you may have to end up with Java Service only list files in a folder/directory with the out of box services as far I am aware of :frowning:


ok. I start with my Java-Service. Maybe somebody has a nother option for me :slight_smile:

For now java service is a good option (as we have developed one as our project common utilities) but you can raise a feature request on SAG brainstorm.

Yes I echo the same with user Mahesh :smiley:

I remember a service listFiles as part of PSUtilities pkg, better try to get it.


Unfortunately it does not list sub directories under a folder.

If there is a equivalent Unix command, you can pass on the Unix command in this service.

It depends how you going to design and purpose, I’m not sure this optional way will be working for you if you not creating Java service,

  1. you can try to create the ftp to the location you want to see or list the file,
  2. create the webMethods flow service to login to the ftp
  3. after login, you can ftp to go to the desired location, and you can list all the file, folders and directory.

You can use pub.utils:executeOSCommand. You have to specify the directory and command in fileAccessControl.cnf file. In outputMessage, you will get list of all folders and files. Then you can use tokenize to segregate each item.
Or you can write java service for this.


dierctory to be listed should be in fileAccessControl.cnf, but the command being executed needs to be mentioned in OSCommands.cnf.

Remember to reload WmPublic package or restart IS to activate the changes in these files.