. * */ namespace OCA\Files\Share; class Api { /** * @brief get share information for a given file/folder * * @param array $params which contains a 'path' to a file/folder * @return \OC_OCS_Result share information */ public static function getShare($params) { $path = $params['path']; $view = new \OC\Files\View('/'.\OCP\User::getUser().'/files'); $fileInfo = $view->getFileInfo($path); if ($fileInfo) { $share = \OCP\Share::getItemShared('file', $fileInfo['fileid']); } else { \OCP\Util::writeLog('files_sharing', 'OCS API getShare, file ' . $path . ' does not exists', \OCP\Util::WARN); $share = array(); } return new \OC_OCS_Result($share); } }