diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-06-08 14:19:26 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-06-08 14:19:26 +0200 |
commit | 80f3a3f4cbecc1e517e6df8841ce457e34eda3e7 (patch) | |
tree | 7437783bd08a027a0cf6ebcb327724ba7a31d41e | |
parent | bc8fe825b2d3d887ce44c6b52d1273b5c331b3cb (diff) | |
parent | 499f56e2b4da6e592b3a18738395add5fd8c30ec (diff) | |
download | nextcloud-server-80f3a3f4cbecc1e517e6df8841ce457e34eda3e7.tar.gz nextcloud-server-80f3a3f4cbecc1e517e6df8841ce457e34eda3e7.zip |
Merge pull request #24 from nextcloud/downstream_smb-rename
implement specific rename handling for SMB
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index c08b730b02e..9f74aa881e0 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -181,6 +181,26 @@ class SMB extends \OC\Files\Storage\Common { } /** + * @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 * * @param string $path |