/**
  * see http://php.net/manual/en/function.rename.php
  *
  * @param string $path1
  * @param string $path2
  * @return bool
  */
 public function rename($path1, $path2)
 {
     $isPartFile = pathinfo($path1, PATHINFO_EXTENSION) === 'part';
     $targetExists = $this->file_exists($path2);
     $sameFodler = dirname($path1) === dirname($path2);
     if ($targetExists || $sameFodler && !$isPartFile) {
         if (!$this->isUpdatable('')) {
             return false;
         }
     } else {
         if (!$this->isCreatable('')) {
             return false;
         }
     }
     return parent::rename($path1, $path2);
 }