From cb5994eba1e359526f6577cb423abd9751a36ee4 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Thu, 2 Jul 2015 22:10:36 +0200 Subject: Remove unnecessary private APIs As discussed here https://github.com/owncloud/core/issues/17197 --- environment/environment.php | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'environment') diff --git a/environment/environment.php b/environment/environment.php index 633a9e07..91a3c191 100644 --- a/environment/environment.php +++ b/environment/environment.php @@ -123,7 +123,10 @@ class Environment { // Resolves reshares down to the last real share $rootLinkItem = Share::resolveReShare($linkItem); $origShareOwner = $rootLinkItem['uid_owner']; - $this->userFolder = $this->setupFilesystem($origShareOwner); + $this->userFolder = $this->serverContainer->getUserFolder($origShareOwner); + // TODO: Replace with this in 8.2 (https://github.com/owncloud/core/pull/16965) + // You get root by calling getRootFolder() on the server container + //$this->userFolder = $this->root->getUserFolder($origShareOwner); // This is actually the node ID $this->sharedNodeId = $linkItem['file_source']; @@ -330,30 +333,6 @@ class Environment { return $path; } - /** - * Sets up the filesystem for the original share owner so that we can - * retrieve the files and returns the userFolder for that user - * - * We can't use 'UserFolder' from Application as the user is not known - * at instantiation time - * - * @param $origShareOwner - * - * @return Folder - */ - private function setupFilesystem($origShareOwner) { - \OC_Util::tearDownFS(); // FIXME: Private API - \OC_Util::setupFS($origShareOwner); // FIXME: Private API - - $folder = $this->serverContainer->getUserFolder($origShareOwner); - - /*// Alternative which does not exist yet - $user = $this->userManager->get($origShareOwner); - $folder = $user->getUserFolder();*/ - - return $folder; - } - /** * Returns the path from the shared folder to the root folder in the original * owner's filesystem: /userId/files/parent_folder/shared_folder -- cgit v1.2.3