summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-07 12:32:51 +0200
committerVincent Petry <pvince81@owncloud.com>2016-06-07 12:32:51 +0200
commit46fe2ddf2e7a4413586095143521684a0377daad (patch)
tree8c1af3037d04152ca66a3487f0ec9d9669ae998e /apps/files_external
parentbf917d7063ed9328a8d367343ac2a6574917ddfb (diff)
parentc9132261c86e7e8c34958bc0998a76db9b4dc75e (diff)
downloadnextcloud-server-46fe2ddf2e7a4413586095143521684a0377daad.tar.gz
nextcloud-server-46fe2ddf2e7a4413586095143521684a0377daad.zip
Merge pull request #23845 from owncloud/smb-rename
implement specific rename handling for SMB
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php20
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