}
/**
- * @return string
+ * @return string|false
*/
public static function file_get_contents($path) {
return self::$defaultInstance->file_get_contents($path);
/**
* @return string
* @throws NotPermittedException
+ * @throws GenericFileException
* @throws LockedException
*/
public function getContent() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_READ)) {
- /**
- * @var \OC\Files\Storage\Storage $storage;
- */
- return $this->view->file_get_contents($this->path);
+ $content = $this->view->file_get_contents($this->path);
+ if ($content === false) {
+ throw new GenericFileException();
+ }
+ return $content;
} else {
throw new NotPermittedException();
}
/**
* @param string|resource $data
* @throws NotPermittedException
- * @throws \OCP\Files\GenericFileException
+ * @throws GenericFileException
* @throws LockedException
*/
public function putContent($data) {
* see https://www.php.net/manual/en/function.file_get_contents.php
*
* @param string $path
- * @return string|bool
+ * @return string|false
*/
public function file_get_contents($path) {
return $this->storage->file_get_contents($this->findPathToUse($path));
* see https://www.php.net/manual/en/function.file_get_contents.php
*
* @param string $path
- * @return string
+ * @return string|false
*/
public function file_get_contents($path) {
$encryptionModule = $this->getEncryptionModule($path);
* see https://www.php.net/manual/en/function.file_get_contents.php
*
* @param string $path
- * @return string|bool
+ * @return string|false
*/
public function file_get_contents($path) {
return $this->getWrapperStorage()->file_get_contents($this->getUnjailedPath($path));
* see https://www.php.net/manual/en/function.file_get_contents.php
*
* @param string $path
- * @return string|bool
+ * @return string|false
*/
public function file_get_contents($path) {
return $this->getWrapperStorage()->file_get_contents($path);
/**
* @param string $path
- * @return mixed
+ * @return string|false
* @throws LockedException
*/
public function file_get_contents($path) {
*
* @return string
* @throws NotPermittedException
+ * @throws GenericFileException
* @throws LockedException
* @since 6.0.0
*/
* see https://www.php.net/manual/en/function.file_get_contents.php
*
* @param string $path
- * @return string|bool
+ * @return string|false
* @since 6.0.0
*/
public function file_get_contents($path);
* see https://www.php.net/manual/en/function.file_get_contents.php
*
* @param string $path
- * @return string|bool
+ * @return string|false
* @since 9.0.0
*/
public function file_get_contents($path);