/**
  * Builds the normalized output array from a Blob object.
  *
  * @param string         $path
  * @param BlobProperties $properties
  *
  * @return array
  */
 protected function normalizeBlobProperties($path, BlobProperties $properties)
 {
     return ['path' => $path, 'timestamp' => (int) $properties->getLastModified()->format('U'), 'dirname' => Util::dirname($path), 'mimetype' => $properties->getContentType(), 'size' => $properties->getContentLength(), 'type' => 'file'];
 }
 /**
  * @covers WindowsAzure\Blob\Models\BlobProperties::setContentLength
  * @covers WindowsAzure\Blob\Models\BlobProperties::getContentLength
  */
 public function testSetContentLength()
 {
     // Setup
     $expected = 100;
     $properties = new BlobProperties();
     $properties->setContentLength($expected);
     // Test
     $properties->setContentLength($expected);
     // Assert
     $this->assertEquals($expected, $properties->getContentLength());
 }
 /**
  * Gets blob blobContentLength.
  *
  * @return integer.
  */
 public function getBlobContentLength()
 {
     return $this->_blobProperties->getContentLength();
 }
Exemple #4
0
 /**
  * Builds the normalized output array from a Blob object.
  *
  * @param string         $path
  * @param BlobProperties $properties
  *
  * @return array
  */
 protected function normalizeBlobProperties($path, BlobProperties $properties)
 {
     if (substr($path, -1) === '/') {
         return ['type' => 'dir', 'path' => $this->removePathPrefix(rtrim($path, '/'))];
     }
     $path = $this->removePathPrefix($path);
     return ['path' => $path, 'timestamp' => (int) $properties->getLastModified()->format('U'), 'dirname' => Util::dirname($path), 'mimetype' => $properties->getContentType(), 'size' => $properties->getContentLength(), 'type' => 'file'];
 }