diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2016-04-07 16:54:37 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-05-31 13:32:11 +0200 |
commit | c9132261c86e7e8c34958bc0998a76db9b4dc75e (patch) | |
tree | e5e928226912b4973b5bf90e69984304b70d6362 /apps/files_external/lib | |
parent | c6183f167cb6ad3171c7e7e652bf14d2a3471711 (diff) | |
download | nextcloud-server-c9132261c86e7e8c34958bc0998a76db9b4dc75e.tar.gz nextcloud-server-c9132261c86e7e8c34958bc0998a76db9b4dc75e.zip |
implement specific rename handling for SMB
Diffstat (limited to 'apps/files_external/lib')
-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 |