Global.helma.File.listRecursive (pattern)
recursivly lists all files below a given directory you may pass a RegExp Pattern to return just files matching this pattern

  • Parameter RegExp:
    pattern to test each file name against
  • Returns
    Array the list of absolute file paths
Sourcecode in /home/hannes/helma/modules/helma/File.js:
395:   this.listRecursive = function(pattern) {
396:         if (!file.isDirectory())
397:            return false;
398:         if (!pattern || pattern.test(file.getName()))
399:            var result = [file.getAbsolutePath()];
400:         else
401:            var result = [];
402:         var arr = file.list();
403:         for (var i=0; i<arr.length; i++) {
404:           var f = new helma.File(file, arr[i]);
405:           if (f.isDirectory())
406:              result = result.concat(f.listRecursive(pattern));
407:           else if (!pattern || pattern.test(arr[i]))
408:              result.push(f.getAbsolutePath());
409:        }
410:        return result;
411:     }