listItems(folderURL, doAutoAuth = true)

The pods:listItems() function returns an array of strings that represents the contents of the specified folder. Each item in the array is the name of an item inside the specified folder. Strings that end in slashes are subfolders; other strings are files. This function is meant to imitate the behavior of the Linux command “ls”. pods:connectStorage() should be called at some point prior to using this function (pods:connectStorage() does not need to be called again if the pico engine is restarted).

The pods:listItems() function has the following parameters:

  • folderURL — A required string parameter that informs the library where the folder exists inside the pod. The folder this URL points to will have its contents listed. This should be a full, absolute URL with an http scheme (e.g. http://examplepodserver.org/podName/folder/).

  • doAutoAuth — An optional boolean parameter that controls automatic authentication attempts. It defaults to true if nothing is passed in for it. When true, the library will check that the stored authentication token is valid if it exists, and if the token is not valid or the token does not exist, the library will attempt to automatically authenticate once.

Copyright Picolabs | Licensed under Creative Commons.