def pathSearchStreaming()

in app/controllers/FileListController.scala [271:290]


  def pathSearchStreaming(vaultId:String, forPath:Option[String], sortField:Option[String], sortDir:Option[String], typeFilter:Option[String]) = IsAuthenticated { uid=> request=>
    (
      userInfoCache.infoForVaultId(vaultId),
      FileListController.SortRequest.fromParamsWithError(sortField, sortDir)
    ) match {
      case (Some(userInfo), Right(sortRequest)) =>
          val searchAttrib = new Attribute(Constants.CONTENT, buildSearchRequest(forPath, typeFilter, sortRequest))
          logger.debug(s"search string is ${searchAttrib.getValue}")
          val graph = searchGraph(userInfo, SearchTerm.createSimpleTerm(searchAttrib))

          Result(
            ResponseHeader(200, Map()),
            HttpEntity.Streamed(Source.fromGraph(graph), None, Some("application/x-ndjson"))
          )
      case (_, Left(problem)) =>
            BadRequest(GenericErrorResponse("bad_request", problem).asJson)
      case (None,_) =>
        NotFound(GenericErrorResponse("not_found", s"no info for vault id $vaultId").asJson)
    }
  }