summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-02 11:01:01 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-06 13:05:13 +0200
commitc9e77c7de49400234f730147f7cf2b4de140bc2b (patch)
treefa579292a792079d111e0705174d9bf2cbb48d64 /lib
parent0d9ad1416571b1e73f590b784dbd7320e75bb0cb (diff)
downloadnextcloud-server-c9e77c7de49400234f730147f7cf2b4de140bc2b.tar.gz
nextcloud-server-c9e77c7de49400234f730147f7cf2b4de140bc2b.zip
Remove unneeded part file
Diffstat (limited to 'lib')
-rw-r--r--lib/private/connector/sabre/file.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 0831bb374d5..f29e3620d4a 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -143,6 +143,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
}
}
catch (\OCP\Files\NotPermittedException $e) {
+ $this->fileView->unlink($partFilePath);
// a more general case - due to whatever reason the content could not be written
throw new \Sabre\DAV\Exception\Forbidden($e->getMessage(), $e->getCode(), $e);
}
@@ -332,6 +333,12 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
$info = $this->fileView->getFileInfo($targetPath);
return $info->getEtag();
+ } catch (\OCP\Files\NotPermittedException $e) {
+ if ($needsPartFile) {
+ $this->fileView->unlink($partFile);
+ }
+ // a more general case - due to whatever reason the content could not be written
+ throw new \Sabre\DAV\Exception\Forbidden($e->getMessage(), $e->getCode(), $e);
} catch (\OCP\Files\StorageNotAvailableException $e) {
throw new \Sabre\DAV\Exception\ServiceUnavailable("Failed to put file: ".$e->getMessage());
}