Ejemplo n.º 1
0
 /**
  * Copy an item in the storage service to a given path.
  *
  * @param  string $sourcePath
  * @param  string $destination path
  * @param  array $options
  * @return void
  */
 public function copyItem($sourcePath, $destinationPath, $options = null)
 {
     $this->_rackspace->copyObject($this->_container, $sourcePath, $this->_container, $destinationPath, $options);
     if (!$this->_rackspace->isSuccessful()) {
         throw new Zend_Cloud_StorageService_Exception('Error on copy: ' . $this->_rackspace->getErrorMsg());
     }
 }
Ejemplo n.º 2
0
 /**
  * Copy the object to another container
  * You can add metadata information to the destination object, change the
  * content_type and the name of the object
  *
  * @param  string $container_dest
  * @param  string $name_dest
  * @param  array $metadata
  * @param  string $content_type
  * @return boolean
  */
 public function copyTo($container_dest, $name_dest, $metadata = array(), $content_type = null)
 {
     return $this->service->copyObject($this->container, $this->name, $container_dest, $name_dest, $metadata, $content_type);
 }
Ejemplo n.º 3
0
 public function testCopyObject()
 {
     $result = $this->rackspace->copyObject(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME, TESTS_ZEND_SERVICE_RACKSPACE_OBJECT_NAME, TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME, TESTS_ZEND_SERVICE_RACKSPACE_OBJECT_NAME . '-copy');
     $this->assertTrue($result);
 }
Ejemplo n.º 4
0
 public function testCopyObject()
 {
     $result = $this->rackspace->copyObject('zf-unit-test', 'zf-object-test', 'zf-unit-test', 'zf-object-test' . '-copy');
     $this->assertTrue($result);
     $this->assertNotContains('application/x-www-form-urlencoded', $this->rackspace->getHttpClient()->getLastRequest());
 }
Ejemplo n.º 5
0
 public function testCopyObject()
 {
     $result = $this->rackspace->copyObject('zf-unit-test', 'zf-object-test', 'zf-unit-test', 'zf-object-test' . '-copy');
     $this->assertTrue($result);
 }
Ejemplo n.º 6
0
 /**
  * Copy an cloud file to another cloud file.
  *
  * @param string $srcName
  * @param string $dstName
  * @return boolean
  */
 public function copyFile($srcName, $dstName, $container = false)
 {
     $container = $container ? $container : $this->getGeneralContainer();
     return $this->_service->copyObject($container, $srcName, $container, $dstName);
 }