summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-04-26 16:45:04 +0200
committerRobin Appelman <robin@icewind.nl>2017-04-26 16:45:04 +0200
commitacb0903514f1a34480589197655281bdc1a16de9 (patch)
tree7f01483ac62aec01652280ddb978dce1c3da629a /apps/files_external/lib
parent43970b93d137f06d64f58819a3c4f48dac07fea1 (diff)
downloadnextcloud-server-acb0903514f1a34480589197655281bdc1a16de9.tar.gz
nextcloud-server-acb0903514f1a34480589197655281bdc1a16de9.zip
remove duplicate method
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php34
1 files changed, 8 insertions, 26 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 8f595f05bc1..7afdb746a98 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -91,6 +91,7 @@ class SMB extends Common implements INotifyStorage {
throw new \Exception('Invalid configuration');
}
$this->statCache = new CappedMemoryCache();
+ parent::__construct($params);
}
/**
@@ -187,16 +188,17 @@ class SMB extends Common implements INotifyStorage {
return false;
}
+ $absoluteSource = $this->buildPath($source);
+ $absoluteTarget = $this->buildPath($target);
try {
- $result = $this->share->rename($this->root . $source, $this->root . $target);
- unset($this->statCache[$this->root . $source], $this->statCache[$this->root . $target]);
+ $result = $this->share->rename($absoluteSource, $absoluteTarget);
} catch (AlreadyExistsException $e) {
- $this->unlink($target);
- $result = $this->share->rename($this->root . $source, $this->root . $target);
- unset($this->statCache[$this->root . $source], $this->statCache[$this->root . $target]);
+ $this->remove($target);
+ $result = $this->share->rename($absoluteSource, $absoluteTarget);
} catch (\Exception $e) {
- $result = false;
+ return false;
}
+ unset($this->statCache[$absoluteSource], $this->statCache[$absoluteTarget]);
return $result;
}
@@ -275,26 +277,6 @@ class SMB extends Common implements INotifyStorage {
}
/**
- * @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