$shared->getToken())); } else { OCP\JSON::success(); } } catch (Exception $exception) { OCP\Util::writeLog('files_sharing', 'Unexpected Error : '.$exception->getMessage(), OCP\Util::ERROR); OCP\JSON::error(array('data' => array('message' => $exception->getMessage()))); } } else { if ($file['encrypted'] == true) { OCP\JSON::error(array('data' => array('message' => 'Encrypted files cannot be shared'))); } else { OCP\Util::writeLog('files_sharing', 'File does not exist or is not readable :'.$source, OCP\Util::ERROR); OCP\JSON::error(array('data' => array('message' => 'File does not exist or is not readable'))); } } } ?>