Ejemplo n.º 1
0
 /**
  * Rename a file.
  *
  * @param string $path    path to file
  * @param string $newpath new path
  *
  * @throws FileExistsException
  * @throws FileNotFoundException
  *
  * @return bool success boolean
  */
 public function rename($path, $newpath)
 {
     $path = Util::normalizePath($path);
     $newpath = Util::normalizePath($newpath);
     $this->assertPresent($path);
     $this->assertAbsent($newpath);
     if ($this->adapter->rename($path, $newpath) === false) {
         return false;
     }
     $this->cache->rename($path, $newpath);
     return true;
 }