Invokes the /database-xxxx/listFolder API method.

    For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Databases#API-method%3A-%2Fdatabase-xxxx%2FlistFolder
353148
def database_list_folder(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/listFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
259569
public String listFolder(ListFolderRequest request) throws AbstractCosException {

		request.check_param();
		request.setCosPath(request.getCosPath() + request.getPrefix());
		String url = buildUrl(request);
		long signExpired = System.currentTimeMillis() / 1000 + this.config.getSignExpired();
		String sign = Sign.getPeriodEffectiveSign(request.getBucketName(), request.getCosPath(), this.cred, signExpired);

		HttpRequest httpRequest = new HttpRequest();
		httpRequest.setUrl(url);
		httpRequest.addHeader(RequestHeaderKey.Authorization, sign);
		httpRequest.addHeader(RequestHeaderKey.USER_AGENT, this.config.getUserAgent());
		httpRequest.addParam(RequestBodyKey.OP, RequestBodyValue.OP.LIST);
		httpRequest.addParam(RequestBodyKey.NUM, String.valueOf(request.getNum()));
		httpRequest.addParam(RequestBodyKey.CONTEXT, request.getContext());
		httpRequest.addParam(RequestBodyKey.ORDER, String.valueOf(request.getOrder().ordinal()));
		httpRequest.addParam(RequestBodyKey.PATTERN, request.getPattern().toString());
		httpRequest.setMethod(HttpMethod.GET);

		return httpClient.sendHttpRequest(httpRequest);
    }
82626
function (caml) {

			var folderQueue = [list.get_rootFolder()];
			var allitems = [];

			return $.Deferred(function (alldfd) {
				ns.modules.funcs.processAsQueue(folderQueue, function (folder) {

					return $.Deferred(function (dfd) {

						ctx.load(folder, ["ServerRelativeUrl"]);
						loadSpElem(folder.get_folders()).done(function (folders) {
							spapi.collectionToArray(folders).forEach(function (n) {
								folderQueue.push(n);
							});

							var folderUrl = folder.get_serverRelativeUrl();
							caml = caml || "<View><RowLimit>1000</RowLimit></View>";

							getAllItemsPaged(caml, folderUrl).done(function (items) {

								for (var i = 0; i < items.length; i++) {

									var li = items[i];
									var vls = li.get_fieldValues();

									if (vls.FSObjType == "1") //folder
									{
										folderQueue.push(li);
									} else {
										allitems.push(li);
									}
								}

								dfd.resolve();
							});

						});
					}).promise();
				}).done(function () {
					alldfd.resolve(allitems);
				});

			}).promise();
		}
1087987
@Override
    public List<Index> listIndexes() throws QueryException {
        try {
            return DatabaseImpl.get(dbQueue.submit(new ListIndexesCallable()));
        }  catch (ExecutionException e) {
            String msg = "Failed to list indexes";
            logger.log(Level.SEVERE, msg, e);
            throw new QueryException(msg, e);
        }

    }
8911
function (xData) {
                    $(xData.responseXML).find("List").each(function () {
                        listXml = $(this);

                        // If listName has been specified, then only return results for that list
                        if ((opt.listName.length === 0) || (listXml.attr("Title") === opt.listName)) {
                            // Don't work with hidden lists unless we're asked to
                            if ((opt.showHiddenLists && listXml.attr("Hidden") === "False") || !opt.showHiddenLists) {

                                // Audit the list's forms
                                if (opt.auditForms) {
                                    // Get the list's Content Types, therefore the form pages
                                    $().SPServices({
                                        operation: "GetListContentTypes",
                                        webURL: opt.webURL,
                                        listName: listXml.attr("ID"),
                                        async: false, // 
                                        completefunc: function (xData) {
                                            $(xData.responseXML).find("ContentType").each(function () {
                                                // Don't deal with folders
                                                if ($(this).attr("ID").substring(0, 6) !== "0x0120") {
                                                    var formUrls = $(this).find("FormUrls");
                                                    for (i = 0; i < formTypes.length; i++) {
                                                        // Look for a customized form...
                                                        $(formUrls).find(formTypes[i][0]).each(function () {
                                                            SPScriptAuditPage(opt, listXml, "Form", this.nodeName, ((opt.webURL.length > 0) ? opt.webURL : $().SPServices.SPGetCurrentSite()) + SLASH + $(this).text());
                                                            formTypes[i][2] = true;
                                                        });
                                                        // ...else the uncustomized form
                                                        if (!formTypes[i][2]) {
                                                            var defaultViewUrl = listXml.attr("DefaultViewUrl");
                                                            SPScriptAuditPage(opt, listXml, "Form", formTypes[i][0],
                                                                defaultViewUrl.substring(0, defaultViewUrl.lastIndexOf(SLASH) + 1) + formTypes[i][1]);
                                                        }
                                                    }
                                                    // Reset the form types
                                                    for (i = 0; i < formTypes.length; i++) {
                                                        formTypes[i][2] = false;
                                                    }
                                                }
                                            });
                                        }
                                    });
                                }

                                // Audit the list's views
                                if (opt.auditViews) {
                                    // Get the list's Views
                                    $().SPServices({
                                        operation: "GetViewCollection",
                                        webURL: opt.webURL,
                                        listName: listXml.attr("ID"),
                                        async: false, // 
                                        completefunc: function (xData) {
                                            $(xData.responseXML).find("View").each(function () {
                                                SPScriptAuditPage(opt, listXml, "View", $(this).attr("DisplayName"), $(this).attr("Url"));
                                            });
                                        }
                                    });
                                }

                            }
                        }
                    });
                }
504682
protected Collection invokePage(int pPageIndex, int pPageSize) {
        if(mDao instanceof BaseSelectPageMapper)
        {
            return ((BaseSelectPageMapper)mDao).selectPage(createModel(),pPageIndex,pPageSize);
        }
        else if( mDao instanceof MysqlSelectPageMapper)
        {
            return ((MysqlSelectPageMapper)mDao).selectPage(createModel(),pPageIndex,pPageSize);
        }
        else if(mDao instanceof  Mapper)
        {
            Mapper mapper= (Mapper)mDao;
            return mapper.selectByRowBounds(createModel(),new RowBounds(pPageIndex-1,pPageSize));
        }
        return new ArrayList();
    }
269088
function list (req, res, next) {
    // Resource chain
    var chain = db.get(name)

    // Remove q, _start, _end, ... from req.query to avoid filtering using those
    // parameters
    var _q = req.query._q
    var _offset = req.query._offset
    var _end = req.query._end
    var _page = req.query._page
    var _sort = req.query._sort
    var _limit = req.query._limit
    var _embed = req.query._embed
    var _expand = req.query._expand
    var _fields = req.query._fields
    var _filter = req.query._filter
    delete req.query._q
    delete req.query._offset
    delete req.query._end
    delete req.query._sort
    delete req.query._limit
    delete req.query._embed
    delete req.query._expand
    delete req.query._fields

    // Automatically delete query parameters that can't be found
    // in the database
    Object.keys(req.query).forEach(function (query) {
      var arr = db.get(name).value()
      for (var i in arr) {
        if (
          _.has(arr[i], query) ||
          query === 'callback' ||
          query === '_' ||
          query.indexOf('_lte') !== -1 ||
          query.indexOf('_gte') !== -1 ||
          query.indexOf('_ne') !== -1 ||
          query.indexOf('_like') !== -1
        ) return
      }
      delete req.query[query]
    })

    if (_q) {
      // Full-text search
      _q = _q.toLowerCase()

      chain = chain.filter(function (obj) {
        for (var key in obj) {
          var value = obj[key]
          if (db._.deepQuery(value, _q)) {
            return true
          }
        }
      })
    }

    var filterMapping = {}

    if (_filter) {
      var filters = _filter.split(',')
      filters.forEach(function (filter) {
        var filterParts = filter.split(operatorsRegex)
        if (filterParts.length !== 3) {
          return
        }
        var key = filterParts[0]
        var op = filterParts[1]
        var value = filterParts[2]

        if (!filterMapping[key + op]) {
          filterMapping[key + op] = {value: []}
        }

        filterMapping[key + op].value.push(value)
        filterMapping[key + op].op = op
      })
    }

    Object.keys(filterMapping).forEach(function (key) {
      var values = filterMapping[key].value

      chain = chain.filter(function (element) {
        return values
            .map(utils.toNative)
            .map(function (value) {
              var op = filterMapping[key].op
              var isDifferent = key.indexOf('!=') !== -1 // op === '!='
              var isRange = key.indexOf('<') !== -1 || key.indexOf('>') !== -1 || key.indexOf('<=') !== -1 || key.indexOf('>=') !== -1 //     op === '<' || op === '>' || op === '<=' || op === '>='
              var isLike = key.indexOf('~') !== -1 || key.indexOf('~=') !== -1 || key.indexOf('=~') !== -1  // op === '~' || op === "~=" || op === '=~'
              var isIn = key.indexOf('|=') !== -1
              var path = key.replace(operatorsRegex, '')
              var elementValue = _.get(element, path)

              if (isRange) {
                switch (op) {
                  case '<':
                    return elementValue < value
                  case '>':
                    return elementValue > value
                  case '<=':
                    return elementValue <= value
                  case '>=':
                    return elementValue >= value
                  default:
                    return false
                }
              } else if (isDifferent) {
                return value !== elementValue
              } else if (isLike) {
                return new RegExp(value, 'i').test(elementValue)
              } else if (isIn) {
                var inValues = value.toString().split('|')
                inValues = _.map(inValues, function (val) {
                  return utils.toNative(val)
                })
                if (Array.isArray(elementValue)) {
                  return _.intersection(elementValue, inValues).length > 0
                } else {
                  return _.includes(inValues, elementValue)
                }
              } else {
                return _.matchesProperty(path, value)(element)
              }
            }).reduce(function (a, b) {
              return a || b
            })
      })
    })

    // Sort
    if (_sort) {
      var sortsParams = _sort.split(',')

      var sortMapping = {}
      sortsParams.forEach(function (sortParam) {
        var order = sortParam[0] === '-' ? 'desc' : 'asc'
        var sortField = sortParam.substring(1)
        sortMapping[sortField] = order
      })

      chain = chain.orderBy(_.keys(sortMapping), _.values(sortMapping)) // TODO iteration order is not guaranteed
    }

    // Slice result
    if (_end || _limit || _page) {
      res.setHeader('X-Total-Count', chain.size())
      res.setHeader('Access-Control-Expose-Headers', 'X-Total-Count')
    }

    if (_page) {
      _page = parseInt(_page, 10)
      _page = _page >= 1 ? _page : 1
      _limit = parseInt(_limit, 10) || 10
      var page = utils.getPage(chain.value(), _page, _limit)
      var links = {}
      var fullURL = getFullURL(req)

      if (page.first) {
        links.first = fullURL.replace('page=' + page.current, 'page=' + page.first)
      }

      if (page.prev) {
        links.prev = fullURL.replace('page=' + page.current, 'page=' + page.prev)
      }

      if (page.next) {
        links.next = fullURL.replace('page=' + page.current, 'page=' + page.next)
      }

      if (page.last) {
        links.last = fullURL.replace('page=' + page.current, 'page=' + page.last)
      }

      res.links(links)
      chain = _.chain(page.items)
    } else if (_end) {
      _offset = parseInt(_offset, 10) || 0
      _end = parseInt(_end, 10)
      chain = chain.slice(_offset, _end)
    } else if (_limit) {
      _offset = parseInt(_offset, 10) || 0
      _limit = parseInt(_limit, 10)
      chain = chain.slice(_offset, _offset + _limit)
    }

    if (_fields) {
      chain = chain.map(function (element) {
        return _.pick(element, _fields.split(','))
      })
    }
    // embed and expand
    chain = chain
      .cloneDeep()
      .forEach(function (element) {
        embed(element, _embed)
        expand(element, _expand)
      })

    res.locals.data = chain.value()
    next()
  }
245270
List<Serializable> executeActionAndCollectData(Action action, String counterName,
			String sessionId, String threadId, String jobId, String cacheId) throws IOException {
		assert action != null;
		final URL actionUrl = getActionUrl(action, counterName, sessionId, threadId, jobId,
				cacheId);
		return collectForUrl(actionUrl);
	}
307662
public function index()
    {
        /** @var \Colibri\Database\ModelCollection $items */
        $items = new $this->listClass();
        $this->applyListFilters($items);
        $items->load();

        $this->template->vars[$this->listTplVar] = $items;
        if ($this->pagedList) {
            $this->template->vars['pagination'] = [
                'page'           => (int)(isset($_GET['page']) ? $_GET['page'] : 0),
                'recordsPerPage' => $items->recordsPerPage,
                'recordsCount'   => $items->recordsCount,
                'pagesCount'     => $items->pagesCount,
                'base_url'       => '/' . $this->division . '/' . $this->module,
            ];
        }
    }
1121737
NamedList<Object> getNamedList(boolean showDebugInfo) throws IOException {
    if (dataCollector.getCollectorType()
        .equals(DataCollector.COLLECTOR_TYPE_LIST)) {
      SimpleOrderedMap<Object> mtasResponseList = new SimpleOrderedMap<>();
      // functions
      Map<String, SimpleOrderedMap<Object>> functionList = new HashMap<>();
      if (functionData != null && functionData.containsKey(dataCollector)) {
        HashMap<String, MtasSolrMtasResult> functionDataItem = functionData
            .get(dataCollector);
        for (Entry<String, MtasSolrMtasResult> entry : functionDataItem
            .entrySet()) {
          MtasSolrMtasResult functionResult = entry.getValue();
          if (functionResult.dataCollector.getCollectorType()
              .equals(DataCollector.COLLECTOR_TYPE_LIST)) {
            NamedList<Object> functionNamedList = functionResult
                .getNamedList(showDebugInfo);
            for (int i = 0; i < functionNamedList.size(); i++) {
              if (functionList.containsKey(functionNamedList.getName(i))) {
                SimpleOrderedMap<Object> tmpMap = functionList
                    .get(functionNamedList.getName(i));
                tmpMap.add(entry.getKey(), functionNamedList.getVal(i));
              } else {
                SimpleOrderedMap<Object> tmpMap = new SimpleOrderedMap<>();
                tmpMap.add(entry.getKey(), functionNamedList.getVal(i));
                functionList.put(functionNamedList.getName(i), tmpMap);
              }
            }
          } else {
            throw new IOException("unexpected function collectorType "
                + functionResult.dataCollector.getCollectorType());
          }
        }
      }
      // main result
      Map<String, ?> dataList = dataCollector.getResult().getList();
      for (Entry<String, ?> entry : dataList.entrySet()) {
        SimpleOrderedMap<Object> mtasResponseListItem = new SimpleOrderedMap<>();
        MtasDataItem<?, ?> dataItem = (MtasDataItem<?, ?>) entry.getValue();
        if (this.distances != null && !this.distances.isEmpty()) {
          SimpleOrderedMap<Object> mtasResponseListItemDistance = new SimpleOrderedMap<>();
          for (SubComponentDistance item : this.distances) {
            mtasResponseListItemDistance.add(item.key,
                item.getDistance().compute(entry.getKey()));
          }
          mtasResponseListItem.add(Distance.NAME, mtasResponseListItemDistance);
        }
        mtasResponseListItem.addAll(dataItem.rewrite(showDebugInfo));
        if (functionList.containsKey(entry.getKey())) {
          mtasResponseListItem.add("functions",
              functionList.get(entry.getKey()));
        }
        if ((subDataType != null) && (dataItem.getSub() != null)) {
          MtasSolrMtasResult css = new MtasSolrMtasResult(dataItem.getSub(),
              subDataType, subStatsType, subStatsItems, subDistances,
              subSortType, subSortDirection, subStart, subNumber, functionData);
          if (dataItem.getSub().getCollectorType()
              .equals(DataCollector.COLLECTOR_TYPE_LIST)) {
            if (css.dataCollector.withTotal()) {
              mtasResponseListItem.add(
                  DataCollector.COLLECTOR_TYPE_LIST + "Total",
                  css.dataCollector.getSize());
            }
            mtasResponseListItem.add(DataCollector.COLLECTOR_TYPE_LIST,
                css.getNamedList(showDebugInfo));
          } else if (dataItem.getSub().getCollectorType()
              .equals(DataCollector.COLLECTOR_TYPE_DATA)) {
            mtasResponseListItem.add(DataCollector.COLLECTOR_TYPE_DATA,
                css.getData(showDebugInfo));
          }
        }
        mtasResponseList.add(entry.getKey(), mtasResponseListItem);
      }
      return mtasResponseList;
    } else {
      throw new IOException(
          "only allowed for " + DataCollector.COLLECTOR_TYPE_LIST);
    }
  }
206759
public function listAction()
    {
        $this->checkFolders();
        $this->view->assign('missingFolders', $this->missingFolders);
        $this->view->assign('storages', $this->storageRepository->load());
    }
954102
NamedList<Object> getData(boolean showDebugInfo) throws IOException {
    if (dataCollector.getCollectorType()
        .equals(DataCollector.COLLECTOR_TYPE_DATA)) {
      NamedList<Object> mtasResponse = new SimpleOrderedMap<>();
      // functions
      Map<String, NamedList<Object>> functionList = new HashMap<>();
      if (functionData != null && functionData.containsKey(dataCollector)) {
        HashMap<String, MtasSolrMtasResult> functionDataItem = functionData
            .get(dataCollector);
        for (Entry<String, MtasSolrMtasResult> entry : functionDataItem
            .entrySet()) {
          MtasSolrMtasResult functionResult = entry.getValue();
          if (functionResult.dataCollector.getCollectorType()
              .equals(DataCollector.COLLECTOR_TYPE_DATA)) {
            NamedList<Object> functionData = functionResult
                .getData(showDebugInfo);
            functionList.put(entry.getKey(), functionData);
          } else {
            throw new IOException("unexpected function collectorType "
                + functionResult.dataCollector.getCollectorType());
          }
        }
      }
      // main result
      MtasDataItem<?, ?> dataItem = dataCollector.getResult().getData();
      if (dataItem != null) {
        mtasResponse.addAll(dataItem.rewrite(showDebugInfo));
        if (functionList.size() > 0) {
          mtasResponse.add("functions", functionList);
        }
        if ((subDataType != null) && (dataItem.getSub() != null)) {
          MtasSolrMtasResult css = new MtasSolrMtasResult(dataItem.getSub(),
              subDataType, subStatsType, subStatsItems, subDistances,
              subSortType, subSortDirection, subStart, subNumber, functionData);
          if (dataItem.getSub().getCollectorType()
              .equals(DataCollector.COLLECTOR_TYPE_LIST)) {
            mtasResponse.add(dataItem.getSub().getCollectorType(),
                css.getNamedList(showDebugInfo));
          } else if (dataItem.getSub().getCollectorType()
              .equals(DataCollector.COLLECTOR_TYPE_DATA)) {
            mtasResponse.add(dataItem.getSub().getCollectorType(),
                css.getData(showDebugInfo));
          }
        }
      }
      return mtasResponse;
    } else {
      throw new IOException(
          "only allowed for " + DataCollector.COLLECTOR_TYPE_DATA);
    }
  }
832256
function (collectionV1) {
        var self = this,
            items = [],
            itemGroupCache = {},
            retainEmpty = self.options.retainEmptyValues;

        // Read all folder data, and prep it so that we can throw subfolders in the right places
        itemGroupCache = _.reduce(collectionV1.folders, function (accumulator, folder) {
            if (!folder) { return accumulator; }

            var auth = self.auth(folder),
                event = self.event(folder),
                variable = self.variable(folder),
                result = {
                    name: folder.name,
                    item: []
                };

            self.options.retainIds && (result._postman_id = folder.id || util.uid());

            if (folder.description) { result.description = folder.description; }
            else if (retainEmpty) { result.description = null; }

            (auth || (auth === null)) && (result.auth = auth);
            event && (result.event = event);
            variable && variable.length && (result.variable = variable);

            accumulator[folder.id] = result;

            return accumulator;
        }, {});

        // Populate each ItemGroup with subfolders
        _.forEach(collectionV1.folders, function (folderV1) {
            if (!folderV1) { return; }

            var itemGroup = itemGroupCache[folderV1.id],
                hasSubfolders = folderV1.folders_order && folderV1.folders_order.length,
                hasRequests = folderV1.order && folderV1.order.length;

            // Add subfolders
            hasSubfolders && _.forEach(folderV1.folders_order, function (subFolderId) {
                if (!itemGroupCache[subFolderId]) {
                    // todo: figure out what to do when a collection contains a subfolder ID,
                    // but the subfolder is not actually there.
                    return;
                }

                itemGroupCache[subFolderId]._postman_isSubFolder = true;

                itemGroup.item.push(itemGroupCache[subFolderId]);
            });

            // Add items
            hasRequests && _.forEach(folderV1.order, function (requestId) {
                if (!self.cache[requestId]) {
                    // todo: what do we do here??
                    return;
                }

                itemGroup.item.push(self.singleItem(self.cache[requestId]));
            });
        });

        // This compromises some self-healing, which was originally present, but the performance cost of
        // doing self-healing the right way is high, so we directly rely on collectionV1.folders_order
        // The self-healing way would be to iterate over itemGroupCache directly, but preserving the right order
        // becomes a pain in that case.
        _.forEach(_.uniq(collectionV1.folders_order || _.map(collectionV1.folders, 'id')), function (folderId) {
            var itemGroup = itemGroupCache[folderId];

            itemGroup && !_.get(itemGroup, '_postman_isSubFolder') && items.push(itemGroup);
        });

        // This is useful later
        self.itemGroupCache = itemGroupCache;

        return _.compact(items);
    }
426424
public function getLists($listType = 2, $isPrivate = true, $folder = null) {
        $data["Envelope"] = array(
            "Body" => array(
                "GetLists" => array(
                    "VISIBILITY" => ($isPrivate ? '0' : '1'),
                    "FOLDER_ID" => $folder,
                    "LIST_TYPE" => $listType,
                ),
            ),
        );
        $response = $this->_request($data);
        $result = $response["Envelope"]["Body"]["RESULT"];
        if ($this->_isSuccess($result)) {
            if (isset($result['LIST']))
                return $result['LIST'];
            else {
                return array(); //?
            }
        } else {
            throw new \Exception("GetLists Error: ".$this->_getErrorFromResponse($response));
        }
    }
613903
def listFunctions(self, dbName=None):
        
        if dbName is None:
            dbName = self.currentDatabase()
        iter = self._jcatalog.listFunctions(dbName).toLocalIterator()
        functions = []
        while iter.hasNext():
            jfunction = iter.next()
            functions.append(Function(
                name=jfunction.name(),
                description=jfunction.description(),
                className=jfunction.className(),
                isTemporary=jfunction.isTemporary()))
        return functions
657360
function listItemsController(path) {
    restController.call(this, 'get', path);

    var ctrl = this;

    /**
     * Ignore empty by default on list controller
     * because parameters are most likly for search
     */
    ctrl.ignoreEmptyParams = true;

    /**
     * Method to paginate a mongoose query
     * @param {Integer} total
     * @param {Query} query
     * @param {Integer} [itemsPerPage=50]
     *
     * @return {Query}
     */
    this.paginate = function(total, query, itemsPerPage) {


        var paginate = require('node-paginate-anything');
        var p = paginate(ctrl.req, ctrl.res, total, itemsPerPage || 50);

        if (!p) {
            return query;
        }

        query.limit(p.limit);
        query.skip(p.skip);

        return query;
    };


    /**
     * List controller use this method to output a service as a rest
     * service
     *
     * This default method is paginated
     *
     * @param {apiService} service
     *
     * @return {Promise}
     */
    this.jsonService = function(service) {

        var params = ctrl.getServiceParameters(ctrl.req);

        var promise = service.getResultPromise(params, ctrl.paginate);

        ctrl.outputJsonFromPromise(service, promise);

        return promise;
    };
}
952239
@Override
	public void invoke(IN tuple) {

		tupleList.add(tuple);
		if (updateCondition()) {
			format.write(path, tupleList);
			resetParameters();
		}

	}