Don't try to be clever
This commit is contained in:
parent
4d3e7fa78a
commit
f2de5a34ef
|
@ -148,6 +148,42 @@ class Server extends SimpleContainer implements IServerContainer {
|
||||||
return $this->query('RootFolder');
|
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
|
* @return \OC\User\Manager
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue