Exemplo 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 Exception\RuntimeException('Error on copy: ' . $this->rackspace->getErrorMsg());
     }
 }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
0
 /**
  * Copy an object to another container
  *
  * @param string $obj_source
  * @param string $container_dest
  * @param string $obj_dest
  * @param array $metadata
  * @param string $content_type
  * @return boolean
  */
 public function copyObject($obj_source, $container_dest, $obj_dest, $metadata = array(), $content_type = null)
 {
     return $this->service->copyObject($this->getName(), $obj_source, $container_dest, $obj_dest, $metadata, $content_type);
 }