summaryrefslogtreecommitdiffstats
path: root/lib/private/files/node/root.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/node/root.php')
-rw-r--r--lib/private/files/node/root.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/private/files/node/root.php b/lib/private/files/node/root.php
index 0be7ee2c499..69c98368dfd 100644
--- a/lib/private/files/node/root.php
+++ b/lib/private/files/node/root.php
@@ -176,8 +176,9 @@ class Root extends Folder implements IRootFolder {
$path = $this->normalizePath($path);
if ($this->isValidPath($path)) {
$fullPath = $this->getFullPath($path);
- if ($this->view->file_exists($fullPath)) {
- return $this->createNode($fullPath);
+ $fileInfo = $this->view->getFileInfo($fullPath);
+ if ($fileInfo) {
+ return $this->createNode($fullPath, $fileInfo);
} else {
throw new NotFoundException($path);
}
@@ -336,18 +337,18 @@ class Root extends Folder implements IRootFolder {
$dir = '/' . $userId;
$folder = null;
- if (!$this->nodeExists($dir)) {
- $folder = $this->newFolder($dir);
- } else {
+ try {
$folder = $this->get($dir);
+ } catch (NotFoundException $e) {
+ $folder = $this->newFolder($dir);
}
$dir = '/files';
- if (!$folder->nodeExists($dir)) {
+ try {
+ $folder = $folder->get($dir);
+ } catch (NotFoundException $e) {
$folder = $folder->newFolder($dir);
\OC_Util::copySkeleton($userId, $folder);
- } else {
- $folder = $folder->get($dir);
}
return $folder;