diff options
Diffstat (limited to '3rdparty/Sabre/DAV/Exception')
18 files changed, 615 insertions, 0 deletions
diff --git a/3rdparty/Sabre/DAV/Exception/BadRequest.php b/3rdparty/Sabre/DAV/Exception/BadRequest.php new file mode 100755 index 00000000000..b198648a754 --- /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-2012 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 100755 index 00000000000..6b0bd1fad73 --- /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-2012 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 100755 index 00000000000..6121868e69e --- /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-2012 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 additional 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 100755 index 00000000000..d76e400c93b --- /dev/null +++ b/3rdparty/Sabre/DAV/Exception/FileNotFound.php @@ -0,0 +1,19 @@ +<?php + +/** + * FileNotFound + * + * Deprecated: Warning, this class is deprecated and will be removed in a + * future version of SabreDAV. Please use Sabre_DAV_Exception_NotFound instead. + * + * @package Sabre + * @subpackage DAV + * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved. + * @author Evert Pot (http://www.rooftopsolutions.nl/) + * @deprecated Use Sabre_DAV_Exception_NotFound instead + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class Sabre_DAV_Exception_FileNotFound extends Sabre_DAV_Exception_NotFound { + +} + diff --git a/3rdparty/Sabre/DAV/Exception/Forbidden.php b/3rdparty/Sabre/DAV/Exception/Forbidden.php new file mode 100755 index 00000000000..20b1056e31b --- /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-2012 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 100755 index 00000000000..1a15089b0a3 --- /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-2012 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 100755 index 00000000000..2230f1d0811 --- /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-2012 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 additional 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 100755 index 00000000000..80ab7aff65a --- /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-2012 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 additional 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 100755 index 00000000000..976365ac1f8 --- /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-2012 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 additional 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 100755 index 00000000000..31875751505 --- /dev/null +++ b/3rdparty/Sabre/DAV/Exception/MethodNotAllowed.php @@ -0,0 +1,45 @@ +<?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-2012 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. + * + * @param Sabre_DAV_Server $server + * @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 100755 index 00000000000..87ca624429f --- /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-2012 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/NotFound.php b/3rdparty/Sabre/DAV/Exception/NotFound.php new file mode 100755 index 00000000000..2b9da560d23 --- /dev/null +++ b/3rdparty/Sabre/DAV/Exception/NotFound.php @@ -0,0 +1,28 @@ +<?php + +/** + * NotFound + * + * 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-2012 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_NotFound 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/NotImplemented.php b/3rdparty/Sabre/DAV/Exception/NotImplemented.php new file mode 100755 index 00000000000..d017a19f559 --- /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-2012 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/PaymentRequired.php b/3rdparty/Sabre/DAV/Exception/PaymentRequired.php new file mode 100755 index 00000000000..4982f45a4b5 --- /dev/null +++ b/3rdparty/Sabre/DAV/Exception/PaymentRequired.php @@ -0,0 +1,28 @@ +<?php + +/** + * Payment Required + * + * The PaymentRequired exception may be thrown in a case where a user must pay + * to access a certain resource or operation. + * + * @package Sabre + * @subpackage DAV + * @copyright Copyright (C) 2007-2012 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_PaymentRequired extends Sabre_DAV_Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 402; + + } + +} diff --git a/3rdparty/Sabre/DAV/Exception/PreconditionFailed.php b/3rdparty/Sabre/DAV/Exception/PreconditionFailed.php new file mode 100755 index 00000000000..213e9c52317 --- /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-2012 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 additional 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 100755 index 00000000000..e86800f3038 --- /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-2012 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 additional 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 100755 index 00000000000..29ee3654a7e --- /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-2012 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 100755 index 00000000000..9a4693b21a8 --- /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-2012 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; + + } + +} |