aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Node/Node.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-28 18:53:20 +0200
committerRobin Appelman <robin@icewind.nl>2022-04-04 15:40:24 +0200
commit754603a04e24a40778816d9965fe31ac7b407910 (patch)
tree418ba20b6656f70c51461f7428178e38fe154aa1 /lib/private/Files/Node/Node.php
parent8b12c75ca258787591d765d301adb57bb4e53d26 (diff)
downloadnextcloud-server-754603a04e24a40778816d9965fe31ac7b407910.tar.gz
nextcloud-server-754603a04e24a40778816d9965fe31ac7b407910.zip
dont needlessly resolve path when getting internalPath/storage from Node
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Node/Node.php')
-rw-r--r--lib/private/Files/Node/Node.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index 0f4193d0608..03975146dda 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -154,12 +154,11 @@ class Node implements \OCP\Files\Node {
}
}
- /**
- * @return \OC\Files\Storage\Storage
- * @throws \OCP\Files\NotFoundException
- */
public function getStorage() {
- [$storage,] = $this->view->resolvePath($this->path);
+ $storage = $this->getMountPoint()->getStorage();
+ if (!$storage) {
+ throw new \Exception("No storage for node");
+ }
return $storage;
}
@@ -174,8 +173,7 @@ class Node implements \OCP\Files\Node {
* @return string
*/
public function getInternalPath() {
- [, $internalPath] = $this->view->resolvePath($this->path);
- return $internalPath;
+ return $this->getFileInfo()->getInternalPath();
}
/**