To read the files that you have in your application, you can use the /definition/listfiles/ command. This will let you list and match files in your application static folders. 

match= How to match files. This command takes two format, you can simply add match=N* to get all files starting on N. You can do a | separated list like match=*.form|*.dlq or you can use a json array in the form match=["N*.html","*.form","*.dql"]
recursive=1 Tell trawler if it should go up all directories.

The currently supported flags

Structure of returned json

The structure in the json is "result" : "ok" and "files" key. This will hold an array of objects. Each object in the array can be of type file or dir.

result
string should be ok if input is right
files array object array of all entries found in folder. There will be one in root, but there can also be one in dir if you do recursive=1
type string in element object, this show the type of element. Can be file or dir
ext string the file extension in element object when this is a file
name string the file name in element object when this is a file
size int The size in bytes in element object when this is a file

All keys

{
    "files": [
        {
            "ext": ".html",
            "name": "createarecord.html",
            "size": 639,
            "type": "file"
        },
        {
            "ext": ".html",
            "name": "createtable.html",
            "size": 4413,
            "type": "file"
        }
    ],
    "result": "ok"
}

The simplest json returned to the user when no recursive and just files

{
    "files": [
        {
            "name": "app",
            "type": "dir"
        },
        {
            "ext": ".html",
            "name": "createarecord.html",
            "size": 639,
            "type": "file"
        },
        {
            "ext": ".html",
            "name": "createtable.html",
            "size": 4413,
            "type": "file"
        }
    ],
    "result": "ok"
}

The json when there also is a directory in the list

{
    "files": [
        {
            "files": [
                {
                    "ext": ".form",
                    "name": "Address.form",
                    "size": 0,
                    "type": "file"
                }
            ],
            "name": "app",
            "type": "dir"
        },
        {
            "ext": ".html",
            "name": "createarecord.html",
            "size": 639,
            "type": "file"
        },
        {
            "ext": ".html",
            "name": "createtable.html",
            "size": 4413,
            "type": "file"
        }
    ],
    "result": "ok"
}

The json when doing recursive