Skip to content

Commit

Permalink
Merge pull request #23845 from owncloud/smb-rename
Browse files Browse the repository at this point in the history
implement specific rename handling for SMB
  • Loading branch information
Vincent Petry committed Jun 7, 2016
2 parents bf917d7 + c913226 commit 46fe2dd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions apps/files_external/lib/Lib/Storage/SMB.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,26 @@ public function unlink($path) {
}
}

/**
* @param string $path1 the old name
* @param string $path2 the new name
* @return bool
*/
public function rename($path1, $path2) {
try {
$this->remove($path2);
$path1 = $this->buildPath($path1);
$path2 = $this->buildPath($path2);
return $this->share->rename($path1, $path2);
} catch (NotFoundException $e) {
return false;
} catch (ForbiddenException $e) {
return false;
} catch (ConnectException $e) {
throw new StorageNotAvailableException($e->getMessage(), $e->getCode(), $e);
}
}

/**
* check if a file or folder has been updated since $time
*
Expand Down

0 comments on commit 46fe2dd

Please sign in to comment.