示例#1
0
 /**
  * Takes a file reference and extracts its meta data.
  *
  * @param \TYPO3\CMS\Core\Resource\File $file
  * @return array
  */
 public function extractMetaData(File $file)
 {
     $localTempFilePath = $file->getForLocalProcessing(FALSE);
     $query = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Tika\\Service\\SolrCellQuery', $localTempFilePath);
     $query->setExtractOnly();
     $response = $this->solr->extract($query);
     $metaData = $this->solrResponseToArray($response[1]);
     $this->cleanupTempFile($localTempFilePath, $file);
     $this->log('Meta Data Extraction using Solr', array('file' => $file, 'solr connection' => (array) $this->solr, 'query' => (array) $query, 'response' => $response, 'meta data' => $metaData));
     return $metaData;
 }