Don't try to be clever

This commit is contained in:
Thomas Tanghus 2013-09-18 14:25:12 +02:00
parent 4d3e7fa78a
commit f2de5a34ef
1 changed files with 36 additions and 0 deletions

View File

@ -148,6 +148,42 @@ class Server extends SimpleContainer implements IServerContainer {
return $this->query('RootFolder');
}
/**
* Returns a view to ownCloud's files folder
*
* @return \OCP\Files\Folder
*/
function getUserFolder() {
$dir = '/files';
$root = $this->getRootFolder();
$folder = null;
if(!$root->nodeExists($dir)) {
$folder = $root->newFolder($dir);
} else {
$folder = $root->get($dir);
}
return $folder;
}
/**
* Returns an app-specific view in ownClouds data directory
*
* @return \OCP\Files\Folder
*/
function getAppFolder() {
$dir = '/' . \OC_App::getCurrentApp();
$root = $this->getRootFolder();
$folder = null;
if(!$root->nodeExists($dir)) {
$folder = $root->newFolder($dir);
} else {
$folder = $root->get($dir);
}
return $folder;
}
/**
* @return \OC\User\Manager
*/