|
|
|
|
@ -6,9 +6,11 @@
|
|
|
|
|
namespace OC\Files\SimpleFS;
|
|
|
|
|
|
|
|
|
|
use OCP\Files\File;
|
|
|
|
|
use OCP\Files\GenericFileException;
|
|
|
|
|
use OCP\Files\NotFoundException;
|
|
|
|
|
use OCP\Files\NotPermittedException;
|
|
|
|
|
use OCP\Files\SimpleFS\ISimpleFile;
|
|
|
|
|
use OCP\Lock\LockedException;
|
|
|
|
|
|
|
|
|
|
class SimpleFile implements ISimpleFile {
|
|
|
|
|
private File $file;
|
|
|
|
|
@ -48,8 +50,10 @@ class SimpleFile implements ISimpleFile {
|
|
|
|
|
/**
|
|
|
|
|
* Get the content
|
|
|
|
|
*
|
|
|
|
|
* @throws NotPermittedException
|
|
|
|
|
* @throws GenericFileException
|
|
|
|
|
* @throws LockedException
|
|
|
|
|
* @throws NotFoundException
|
|
|
|
|
* @throws NotPermittedException
|
|
|
|
|
*/
|
|
|
|
|
public function getContent(): string {
|
|
|
|
|
$result = $this->file->getContent();
|
|
|
|
|
@ -65,8 +69,10 @@ class SimpleFile implements ISimpleFile {
|
|
|
|
|
* Overwrite the file
|
|
|
|
|
*
|
|
|
|
|
* @param string|resource $data
|
|
|
|
|
* @throws NotPermittedException
|
|
|
|
|
* @throws GenericFileException
|
|
|
|
|
* @throws LockedException
|
|
|
|
|
* @throws NotFoundException
|
|
|
|
|
* @throws NotPermittedException
|
|
|
|
|
*/
|
|
|
|
|
public function putContent($data): void {
|
|
|
|
|
try {
|
|
|
|
|
|