Example #1
0
 /**
  * Returns display information for a get response on a non-collection.
  *
  * This method returns the display information generated for a $response
  * object of type {@link ezcWebdavGetResourceResponse}. It returns an
  * instance of {@link ezcWebdavDisplayInformation} containing the
  * post-processed response object and the appropriate body.
  *
  * This response returns a very seldom (for this component) string
  * response, since it returns the raw content of the requested resource.
  *
  * @param ezcWebdavGetResourceResponse $response 
  * @return ezcWebdavStringDisplayInformation
  */
 protected function processGetResourceResponse(ezcWebdavGetResourceResponse $response)
 {
     // Generate Content-Type header if necessary
     if ($response->getHeader('Content-Type') === null) {
         $contentTypeProperty = $response->resource->liveProperties->get('getcontenttype');
         $contentTypeHeader = ($contentTypeProperty->mime !== null ? $contentTypeProperty->mime : 'application/octet-stream') . '; charset="' . ($contentTypeProperty->charset !== null ? $contentTypeProperty->charset : 'utf-8') . '"';
         $response->setHeader('Content-Type', $contentTypeHeader);
     }
     // Content-Length automatically send by web server
     return new ezcWebdavStringDisplayInformation($response, $response->resource->content);
 }