diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 322731d677..6571386f5c 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -13,6 +13,7 @@ * @author Robin Appelman * @author Thomas Müller * @author Vincent Petry + * @author Daniel Rudolf * * @license AGPL-3.0 * @@ -403,6 +404,21 @@ class AppManager implements IAppManager { return $appPath; } + /** + * Get the web path for the given app. + * + * @param string $appId + * @return string + * @throws AppPathNotFoundException if app path can't be found + */ + public function getAppWebPath($appId) { + $appWebPath = \OC_App::getAppWebPath($appId); + if($appWebPath === false) { + throw new AppPathNotFoundException('Could not find web path for ' . $appId); + } + return $appWebPath; + } + /** * Clear the cached list of apps when enabling/disabling an app */ diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index aebd47b3a2..c57b94382a 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -8,6 +8,7 @@ * @author Morris Jobke * @author Robin Appelman * @author Thomas Müller + * @author Daniel Rudolf * * @license AGPL-3.0 * @@ -125,6 +126,16 @@ interface IAppManager { */ public function getAppPath($appId); + /** + * Get the web path for the given app. + * + * @param string $appId + * @return string + * @since 17.0.0 + * @throws AppPathNotFoundException + */ + public function getAppWebPath($appId); + /** * List all apps enabled for a user *