I rebased the function on the 'createFolder' function.
Running on Cordova, it was unable to get the content of a "deep" folder, like aaa/bbb/ccc, although it was working in Chrome.