public List<ApplicationFile> listFiles(boolean recurse) {
        List<ApplicationFile> ret = new ArrayList<>();
        List<ApplicationFile> files = listFiles();
        ret.addAll(files);
        if (recurse) {
            for (ApplicationFile file : files) {
                if (file.isDirectory()) {
                    ret.addAll(file.listFiles(recurse));
                }
            }
        }
        return ret;
    }
Lists the files in this directory, optionally lists files for subdirectories recursively as well.

@param recurse Set to true if all files in the directory tree should be returned.
@return a list of files in this directory.
config-model-api/src/main/java/com/yahoo/config/application/api/ApplicationFile.java