summaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/DAV/Exception
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/Sabre/DAV/Exception')
-rw-r--r--3rdparty/Sabre/DAV/Exception/BadRequest.php28
-rw-r--r--3rdparty/Sabre/DAV/Exception/Conflict.php28
-rw-r--r--3rdparty/Sabre/DAV/Exception/ConflictingLock.php35
-rw-r--r--3rdparty/Sabre/DAV/Exception/FileNotFound.php28
-rw-r--r--3rdparty/Sabre/DAV/Exception/Forbidden.php27
-rw-r--r--3rdparty/Sabre/DAV/Exception/InsufficientStorage.php27
-rw-r--r--3rdparty/Sabre/DAV/Exception/InvalidResourceType.php33
-rw-r--r--3rdparty/Sabre/DAV/Exception/LockTokenMatchesRequestUri.php39
-rw-r--r--3rdparty/Sabre/DAV/Exception/Locked.php67
-rw-r--r--3rdparty/Sabre/DAV/Exception/MethodNotAllowed.php44
-rw-r--r--3rdparty/Sabre/DAV/Exception/NotAuthenticated.php28
-rw-r--r--3rdparty/Sabre/DAV/Exception/NotImplemented.php27
-rw-r--r--3rdparty/Sabre/DAV/Exception/PreconditionFailed.php69
-rw-r--r--3rdparty/Sabre/DAV/Exception/ReportNotImplemented.php30
-rw-r--r--3rdparty/Sabre/DAV/Exception/RequestedRangeNotSatisfiable.php29
-rw-r--r--3rdparty/Sabre/DAV/Exception/UnsupportedMediaType.php28
16 files changed, 567 insertions, 0 deletions
diff --git a/3rdparty/Sabre/DAV/Exception/BadRequest.php b/3rdparty/Sabre/DAV/Exception/BadRequest.php
new file mode 100644
index 00000000000..7025bb10317
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/BadRequest.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * BadRequest
+ *
+ * The BadRequest is thrown when the user submitted an invalid HTTP request
+ * BadRequest
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_BadRequest extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 400;
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/Conflict.php b/3rdparty/Sabre/DAV/Exception/Conflict.php
new file mode 100644
index 00000000000..7eaa08178ae
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/Conflict.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * Conflict
+ *
+ * A 409 Conflict is thrown when a user tried to make a directory over an existing
+ * file or in a parent directory that doesn't exist.
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_Conflict extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 409;
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/ConflictingLock.php b/3rdparty/Sabre/DAV/Exception/ConflictingLock.php
new file mode 100644
index 00000000000..279f63dfde7
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/ConflictingLock.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * ConflictingLock
+ *
+ * Similar to Exception_Locked, this exception thrown when a LOCK request
+ * was made, on a resource which was already locked
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_ConflictingLock extends Sabre_DAV_Exception_Locked {
+
+ /**
+ * This method allows the exception to include additonal information into the WebDAV error response
+ *
+ * @param Sabre_DAV_Server $server
+ * @param DOMElement $errorNode
+ * @return void
+ */
+ public function serialize(Sabre_DAV_Server $server,DOMElement $errorNode) {
+
+ if ($this->lock) {
+ $error = $errorNode->ownerDocument->createElementNS('DAV:','d:no-conflicting-lock');
+ $errorNode->appendChild($error);
+ if (!is_object($this->lock)) var_dump($this->lock);
+ $error->appendChild($errorNode->ownerDocument->createElementNS('DAV:','d:href',$this->lock->uri));
+ }
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/FileNotFound.php b/3rdparty/Sabre/DAV/Exception/FileNotFound.php
new file mode 100644
index 00000000000..b20e4a2fb3f
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/FileNotFound.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * FileNotFound
+ *
+ * This Exception is thrown when a Node couldn't be found. It returns HTTP error code 404
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_FileNotFound extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 404;
+
+ }
+
+}
+
diff --git a/3rdparty/Sabre/DAV/Exception/Forbidden.php b/3rdparty/Sabre/DAV/Exception/Forbidden.php
new file mode 100644
index 00000000000..167f3c2760a
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/Forbidden.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Forbidden
+ *
+ * This exception is thrown whenever a user tries to do an operation he's not allowed to
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_Forbidden extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 403;
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/InsufficientStorage.php b/3rdparty/Sabre/DAV/Exception/InsufficientStorage.php
new file mode 100644
index 00000000000..15007cdd352
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/InsufficientStorage.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * InsufficientStorage
+ *
+ * This Exception can be thrown, when for example a harddisk is full or a quota is exceeded
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_InsufficientStorage extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 507;
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/InvalidResourceType.php b/3rdparty/Sabre/DAV/Exception/InvalidResourceType.php
new file mode 100644
index 00000000000..f06810a25ef
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/InvalidResourceType.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * InvalidResourceType
+ *
+ * This exception is thrown when the user tried to create a new collection, with
+ * a special resourcetype value that was not recognized by the server.
+ *
+ * See RFC5689 section 3.3
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_InvalidResourceType extends Sabre_DAV_Exception_Forbidden {
+
+ /**
+ * This method allows the exception to include additonal information into the WebDAV error response
+ *
+ * @param Sabre_DAV_Server $server
+ * @param DOMElement $errorNode
+ * @return void
+ */
+ public function serialize(Sabre_DAV_Server $server,DOMElement $errorNode) {
+
+ $error = $errorNode->ownerDocument->createElementNS('DAV:','d:valid-resourcetype');
+ $errorNode->appendChild($error);
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/LockTokenMatchesRequestUri.php b/3rdparty/Sabre/DAV/Exception/LockTokenMatchesRequestUri.php
new file mode 100644
index 00000000000..47032cffc75
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/LockTokenMatchesRequestUri.php
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * LockTokenMatchesRequestUri
+ *
+ * This exception is thrown by UNLOCK if a supplied lock-token is invalid
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_LockTokenMatchesRequestUri extends Sabre_DAV_Exception_Conflict {
+
+ /**
+ * Creates the exception
+ */
+ public function __construct() {
+
+ $this->message = 'The locktoken supplied does not match any locks on this entity';
+
+ }
+
+ /**
+ * This method allows the exception to include additonal information into the WebDAV error response
+ *
+ * @param Sabre_DAV_Server $server
+ * @param DOMElement $errorNode
+ * @return void
+ */
+ public function serialize(Sabre_DAV_Server $server,DOMElement $errorNode) {
+
+ $error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-matches-request-uri');
+ $errorNode->appendChild($error);
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/Locked.php b/3rdparty/Sabre/DAV/Exception/Locked.php
new file mode 100644
index 00000000000..b4bb2e0378c
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/Locked.php
@@ -0,0 +1,67 @@
+<?php
+
+/**
+ * Locked
+ *
+ * The 423 is thrown when a client tried to access a resource that was locked, without supplying a valid lock token
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_Locked extends Sabre_DAV_Exception {
+
+ /**
+ * Lock information
+ *
+ * @var Sabre_DAV_Locks_LockInfo
+ */
+ protected $lock;
+
+ /**
+ * Creates the exception
+ *
+ * A LockInfo object should be passed if the user should be informed
+ * which lock actually has the file locked.
+ *
+ * @param Sabre_DAV_Locks_LockInfo $lock
+ */
+ public function __construct(Sabre_DAV_Locks_LockInfo $lock = null) {
+
+ $this->lock = $lock;
+
+ }
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 423;
+
+ }
+
+ /**
+ * This method allows the exception to include additonal information into the WebDAV error response
+ *
+ * @param Sabre_DAV_Server $server
+ * @param DOMElement $errorNode
+ * @return void
+ */
+ public function serialize(Sabre_DAV_Server $server,DOMElement $errorNode) {
+
+ if ($this->lock) {
+ $error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-submitted');
+ $errorNode->appendChild($error);
+ if (!is_object($this->lock)) var_dump($this->lock);
+ $error->appendChild($errorNode->ownerDocument->createElementNS('DAV:','d:href',$this->lock->uri));
+ }
+
+ }
+
+}
+
diff --git a/3rdparty/Sabre/DAV/Exception/MethodNotAllowed.php b/3rdparty/Sabre/DAV/Exception/MethodNotAllowed.php
new file mode 100644
index 00000000000..02c145ffeb6
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/MethodNotAllowed.php
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * MethodNotAllowed
+ *
+ * The 405 is thrown when a client tried to create a directory on an already existing directory
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_MethodNotAllowed extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 405;
+
+ }
+
+ /**
+ * This method allows the exception to return any extra HTTP response headers.
+ *
+ * The headers must be returned as an array.
+ *
+ * @return array
+ */
+ public function getHTTPHeaders(Sabre_DAV_Server $server) {
+
+ $methods = $server->getAllowedMethods($server->getRequestUri());
+
+ return array(
+ 'Allow' => strtoupper(implode(', ',$methods)),
+ );
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/NotAuthenticated.php b/3rdparty/Sabre/DAV/Exception/NotAuthenticated.php
new file mode 100644
index 00000000000..1faffddfa00
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/NotAuthenticated.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * NotAuthenticated
+ *
+ * This exception is thrown when the client did not provide valid
+ * authentication credentials.
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_NotAuthenticated extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 401;
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/NotImplemented.php b/3rdparty/Sabre/DAV/Exception/NotImplemented.php
new file mode 100644
index 00000000000..cd7f609b09d
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/NotImplemented.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * NotImplemented
+ *
+ * This exception is thrown when the client tried to call an unsupported HTTP method or other feature
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_NotImplemented extends Sabre_DAV_Exception {
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 501;
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/PreconditionFailed.php b/3rdparty/Sabre/DAV/Exception/PreconditionFailed.php
new file mode 100644
index 00000000000..ebcb9f5b9ac
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/PreconditionFailed.php
@@ -0,0 +1,69 @@
+<?php
+
+/**
+ * PreconditionFailed
+ *
+ * This exception is normally thrown when a client submitted a conditional request,
+ * like for example an If, If-None-Match or If-Match header, which caused the HTTP
+ * request to not execute (the condition of the header failed)
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_PreconditionFailed extends Sabre_DAV_Exception {
+
+ /**
+ * When this exception is thrown, the header-name might be set.
+ *
+ * This allows the exception-catching code to determine which HTTP header
+ * caused the exception.
+ *
+ * @var string
+ */
+ public $header = null;
+
+ /**
+ * Create the exception
+ *
+ * @param string $message
+ * @param string $header
+ */
+ public function __construct($message, $header=null) {
+
+ parent::__construct($message);
+ $this->header = $header;
+
+ }
+
+ /**
+ * Returns the HTTP statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 412;
+
+ }
+
+ /**
+ * This method allows the exception to include additonal information into the WebDAV error response
+ *
+ * @param Sabre_DAV_Server $server
+ * @param DOMElement $errorNode
+ * @return void
+ */
+ public function serialize(Sabre_DAV_Server $server,DOMElement $errorNode) {
+
+ if ($this->header) {
+ $prop = $errorNode->ownerDocument->createElement('s:header');
+ $prop->nodeValue = $this->header;
+ $errorNode->appendChild($prop);
+ }
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/ReportNotImplemented.php b/3rdparty/Sabre/DAV/Exception/ReportNotImplemented.php
new file mode 100644
index 00000000000..e4ed601b16c
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/ReportNotImplemented.php
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * ReportNotImplemented
+ *
+ * This exception is thrown when the client requested an unknown report through the REPORT method
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_ReportNotImplemented extends Sabre_DAV_Exception_NotImplemented {
+
+ /**
+ * This method allows the exception to include additonal information into the WebDAV error response
+ *
+ * @param Sabre_DAV_Server $server
+ * @param DOMElement $errorNode
+ * @return void
+ */
+ public function serialize(Sabre_DAV_Server $server,DOMElement $errorNode) {
+
+ $error = $errorNode->ownerDocument->createElementNS('DAV:','d:supported-report');
+ $errorNode->appendChild($error);
+
+ }
+
+}
diff --git a/3rdparty/Sabre/DAV/Exception/RequestedRangeNotSatisfiable.php b/3rdparty/Sabre/DAV/Exception/RequestedRangeNotSatisfiable.php
new file mode 100644
index 00000000000..37abbd729d1
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/RequestedRangeNotSatisfiable.php
@@ -0,0 +1,29 @@
+<?php
+
+/**
+ * RequestedRangeNotSatisfiable
+ *
+ * This exception is normally thrown when the user
+ * request a range that is out of the entity bounds.
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_RequestedRangeNotSatisfiable extends Sabre_DAV_Exception {
+
+ /**
+ * returns the http statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 416;
+
+ }
+
+}
+
diff --git a/3rdparty/Sabre/DAV/Exception/UnsupportedMediaType.php b/3rdparty/Sabre/DAV/Exception/UnsupportedMediaType.php
new file mode 100644
index 00000000000..4c37d8997cf
--- /dev/null
+++ b/3rdparty/Sabre/DAV/Exception/UnsupportedMediaType.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * UnSupportedMediaType
+ *
+ * The 415 Unsupported Media Type status code is generally sent back when the client
+ * tried to call an HTTP method, with a body the server didn't understand
+ *
+ * @package Sabre
+ * @subpackage DAV
+ * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
+ */
+class Sabre_DAV_Exception_UnsupportedMediaType extends Sabre_DAV_Exception {
+
+ /**
+ * returns the http statuscode for this exception
+ *
+ * @return int
+ */
+ public function getHTTPCode() {
+
+ return 415;
+
+ }
+
+}