Ejemplo n.º 1
0
 /**
  * Returns all properties and metadata on the blob.
  * 
  * @param string                        $container name of the container
  * @param string                        $blob      name of the blob
  * @param Models\GetBlobMetadataOptions $options   optional parameters
  * 
  * @return Models\GetBlobMetadataResult
  * 
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/dd179350.aspx
  */
 public function getBlobMetadata($container, $blob, $options = null)
 {
     Validate::isString($container, 'container');
     Validate::isString($blob, 'blob');
     Validate::notNullOrEmpty($blob, 'blob');
     $method = Resources::HTTP_HEAD;
     $headers = array();
     $postParams = array();
     $queryParams = array();
     $path = $this->_createPath($container, $blob);
     $statusCode = Resources::STATUS_OK;
     if (is_null($options)) {
         $options = new GetBlobMetadataOptions();
     }
     $headers = $this->addOptionalAccessConditionHeader($headers, $options->getAccessCondition());
     $this->addOptionalHeader($headers, Resources::X_MS_LEASE_ID, $options->getLeaseId());
     $this->addOptionalQueryParam($queryParams, Resources::QP_SNAPSHOT, $options->getSnapshot());
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $this->addOptionalQueryParam($queryParams, Resources::QP_COMP, 'metadata');
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode);
     $metadata = $this->getMetadataArray($response->getHeader());
     return GetBlobMetadataResult::create($response->getHeader(), $metadata);
 }