summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/SimpleFS/SimpleFile.php13
-rw-r--r--lib/public/Files/SimpleFS/ISimpleFile.php1
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/private/Files/SimpleFS/SimpleFile.php b/lib/private/Files/SimpleFS/SimpleFile.php
index 7b83e9372f7..9c9ca10650c 100644
--- a/lib/private/Files/SimpleFS/SimpleFile.php
+++ b/lib/private/Files/SimpleFS/SimpleFile.php
@@ -99,9 +99,14 @@ class SimpleFile implements ISimpleFile {
*
* @param string|resource $data
* @throws NotPermittedException
+ * @throws NotFoundException
*/
public function putContent($data) {
- $this->file->putContent($data);
+ try {
+ return $this->file->putContent($data);
+ } catch (NotFoundException $e) {
+ $this->checkFile();
+ }
}
/**
@@ -119,7 +124,11 @@ class SimpleFile implements ISimpleFile {
while ($cur->stat() === false) {
$parent = $cur->getParent();
- $cur->delete();
+ try {
+ $cur->delete();
+ } catch (NotFoundException $e) {
+ // Just continue then
+ }
$cur = $parent;
}
diff --git a/lib/public/Files/SimpleFS/ISimpleFile.php b/lib/public/Files/SimpleFS/ISimpleFile.php
index a3cd3245cc7..b00f5c482c6 100644
--- a/lib/public/Files/SimpleFS/ISimpleFile.php
+++ b/lib/public/Files/SimpleFS/ISimpleFile.php
@@ -80,6 +80,7 @@ interface ISimpleFile {
*
* @param string|resource $data
* @throws NotPermittedException
+ * @throws NotFoundException
* @since 11.0.0
*/
public function putContent($data);