diff options
author | Julius Haertl <jus@bitgrid.net> | 2016-11-17 12:30:52 +0100 |
---|---|---|
committer | Julius Haertl <jus@bitgrid.net> | 2016-11-17 19:24:24 +0100 |
commit | caacb6c261140cd8f86ba5e430d2d9af217eae45 (patch) | |
tree | ae0f85faf2600eeabbea254537f1cb9fc29535b1 /lib/private/App/AppManager.php | |
parent | de983e61e3660964154d1c7f447ca8a2055cc2d6 (diff) | |
download | nextcloud-server-caacb6c261140cd8f86ba5e430d2d9af217eae45.tar.gz nextcloud-server-caacb6c261140cd8f86ba5e430d2d9af217eae45.zip |
Expose getAppPath to public API
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/App/AppManager.php')
-rw-r--r-- | lib/private/App/AppManager.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 55fd575e129..fca5c9b87ac 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -31,6 +31,7 @@ namespace OC\App; +use OCP\App\AppPathNotFoundException; use OCP\App\IAppManager; use OCP\App\ManagerEvent; use OCP\IAppConfig; @@ -266,6 +267,21 @@ class AppManager implements IAppManager { } /** + * Get the directory for the given app. + * + * @param string $appId + * @return string + * @throws AppPathNotFoundException if app folder can't be found + */ + public function getAppPath($appId) { + $appPath = \OC_App::getAppPath($appId); + if($appPath === false) { + throw new AppPathNotFoundException('Could not find path for ' . $appId); + } + return $appPath; + } + + /** * Clear the cached list of apps when enabling/disabling an app */ public function clearAppsCache() { |