summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre/exception/filelocked.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/connector/sabre/exception/filelocked.php')
-rw-r--r--lib/private/connector/sabre/exception/filelocked.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/exception/filelocked.php b/lib/private/connector/sabre/exception/filelocked.php
new file mode 100644
index 00000000000..ec200f847e3
--- /dev/null
+++ b/lib/private/connector/sabre/exception/filelocked.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Owen Winkler
+ * @copyright 2013 Owen Winkler <owen@owncloud.com>
+ *
+ */
+
+class OC_Connector_Sabre_Exception_FileLocked extends Sabre_DAV_Exception {
+
+ public function __construct($message = "", $code = 0, Exception $previous = null) {
+ if($previous instanceof \OCP\Files\LockNotAcquiredException) {
+ $message = sprintf('Target file %s is locked by another process.', $previous->path);
+ }
+ parent::__construct($message, $code, $previous);
+ }
+
+ /**
+ * Returns the HTTP status code for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 503;
+ }
+}