You are here

public function SearchApiSolrService::getFile in Search API Solr 7

Retrieves a config file or file list from the Solr server.

Uses the admin/file request handler.

Parameters

string|null $file: (optional) The name of the file to retrieve. If the file is a directory, the directory contents are instead listed and returned. NULL represents the root config directory.

Return value

object A HTTP response object containing either the file contents or a file list.

File

includes/service.inc, line 2705

Class

SearchApiSolrService
Search service class using Solr server.

Code

public function getFile($file = NULL) {
  $this
    ->connect();
  $file_servlet_name = constant($this
    ->getConnectionClass() . '::FILE_SERVLET');
  $params['contentType'] = 'text/xml;charset=utf-8';
  if ($file) {
    $params['file'] = $file;
  }
  return $this->solr
    ->makeServletRequest($file_servlet_name, $params);
}