From caacb6c261140cd8f86ba5e430d2d9af217eae45 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Thu, 17 Nov 2016 12:30:52 +0100 Subject: Expose getAppPath to public API Signed-off-by: Julius Haertl --- lib/private/App/AppManager.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/private/App/AppManager.php') 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; @@ -265,6 +266,21 @@ class AppManager implements IAppManager { $this->clearAppsCache(); } + /** + * 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 */ -- cgit v1.2.3