diff options
Diffstat (limited to 'vendor/sabre/dav/lib/Sabre/DAV/Exception')
19 files changed, 665 insertions, 0 deletions
diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/BadRequest.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/BadRequest.php new file mode 100644 index 000000000..bcf4c8eb4 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/BadRequest.php @@ -0,0 +1,28 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * BadRequest + * + * The BadRequest is thrown when the user submitted an invalid HTTP request + * BadRequest + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class BadRequest extends \Sabre\DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 400; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/Conflict.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/Conflict.php new file mode 100644 index 000000000..2c8fa8167 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/Conflict.php @@ -0,0 +1,28 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * 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. + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class Conflict extends \Sabre\DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 409; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/ConflictingLock.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/ConflictingLock.php new file mode 100644 index 000000000..ba66f243d --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/ConflictingLock.php @@ -0,0 +1,37 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * ConflictingLock + * + * Similar to the Locked exception, this exception thrown when a LOCK request + * was made, on a resource which was already locked + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class ConflictingLock extends Locked { + + /** + * This method allows the exception to include additional information into the WebDAV error response + * + * @param DAV\Server $server + * @param \DOMElement $errorNode + * @return void + */ + public function serialize(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/vendor/sabre/dav/lib/Sabre/DAV/Exception/FileNotFound.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/FileNotFound.php new file mode 100644 index 000000000..da700ebb0 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/FileNotFound.php @@ -0,0 +1,19 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * FileNotFound + * + * Deprecated: Warning, this class is deprecated and will be removed in a + * future version of SabreDAV. Please use Sabre\DAV\Exception\NotFound instead. + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @deprecated Use Sabre\DAV\Exception\NotFound instead + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class FileNotFound extends NotFound { + +} + diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/Forbidden.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/Forbidden.php new file mode 100644 index 000000000..3c9a46677 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/Forbidden.php @@ -0,0 +1,27 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * Forbidden + * + * This exception is thrown whenever a user tries to do an operation he's not allowed to + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class Forbidden extends \Sabre\DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 403; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/InsufficientStorage.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/InsufficientStorage.php new file mode 100644 index 000000000..8505ce17f --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/InsufficientStorage.php @@ -0,0 +1,27 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * InsufficientStorage + * + * This Exception can be thrown, when for example a harddisk is full or a quota is exceeded + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class InsufficientStorage extends \Sabre\DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 507; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/InvalidResourceType.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/InvalidResourceType.php new file mode 100644 index 000000000..ce64f2ee0 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/InvalidResourceType.php @@ -0,0 +1,33 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * 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 + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class InvalidResourceType extends Forbidden { + + /** + * This method allows the exception to include additional information into the WebDAV error response + * + * @param 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/vendor/sabre/dav/lib/Sabre/DAV/Exception/LockTokenMatchesRequestUri.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/LockTokenMatchesRequestUri.php new file mode 100644 index 000000000..a8f8407f0 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/LockTokenMatchesRequestUri.php @@ -0,0 +1,41 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * LockTokenMatchesRequestUri + * + * This exception is thrown by UNLOCK if a supplied lock-token is invalid + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class LockTokenMatchesRequestUri extends 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 DAV\Server $server + * @param \DOMElement $errorNode + * @return void + */ + public function serialize(DAV\Server $server,\DOMElement $errorNode) { + + $error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-matches-request-uri'); + $errorNode->appendChild($error); + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/Locked.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/Locked.php new file mode 100644 index 000000000..2f8460be2 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/Locked.php @@ -0,0 +1,73 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * Locked + * + * The 423 is thrown when a client tried to access a resource that was locked, without supplying a valid lock token + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class Locked extends 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 DAV\Locks\LockInfo $lock + */ + public function __construct(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 DAV\Server $server + * @param \DOMElement $errorNode + * @return void + */ + public function serialize(DAV\Server $server,\DOMElement $errorNode) { + + if ($this->lock) { + $error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-submitted'); + $errorNode->appendChild($error); + + $href = $errorNode->ownerDocument->createElementNS('DAV:','d:href'); + $href->appendChild($errorNode->ownerDocument->createTextNode($this->lock->uri)); + $error->appendChild( + $href + ); + } + + } + +} + diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/MethodNotAllowed.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/MethodNotAllowed.php new file mode 100644 index 000000000..09aeca4c8 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/MethodNotAllowed.php @@ -0,0 +1,45 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * MethodNotAllowed + * + * The 405 is thrown when a client tried to create a directory on an already existing directory + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class 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/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotAuthenticated.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotAuthenticated.php new file mode 100644 index 000000000..695edda15 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotAuthenticated.php @@ -0,0 +1,30 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * NotAuthenticated + * + * This exception is thrown when the client did not provide valid + * authentication credentials. + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class NotAuthenticated extends DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 401; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotFound.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotFound.php new file mode 100644 index 000000000..605c650a4 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotFound.php @@ -0,0 +1,28 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * NotFound + * + * This Exception is thrown when a Node couldn't be found. It returns HTTP error code 404 + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class NotFound extends \Sabre\DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 404; + + } + +} + diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotImplemented.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotImplemented.php new file mode 100644 index 000000000..6934a53e5 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/NotImplemented.php @@ -0,0 +1,27 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * NotImplemented + * + * This exception is thrown when the client tried to call an unsupported HTTP method or other feature + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class NotImplemented extends \Sabre\DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 501; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/PaymentRequired.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/PaymentRequired.php new file mode 100644 index 000000000..ad053fd79 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/PaymentRequired.php @@ -0,0 +1,30 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * Payment Required + * + * The PaymentRequired exception may be thrown in a case where a user must pay + * to access a certain resource or operation. + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class PaymentRequired extends DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 402; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/PreconditionFailed.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/PreconditionFailed.php new file mode 100644 index 000000000..225b99a36 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/PreconditionFailed.php @@ -0,0 +1,71 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * 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) + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class PreconditionFailed extends 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 DAV\Server $server + * @param \DOMElement $errorNode + * @return void + */ + public function serialize(DAV\Server $server,\DOMElement $errorNode) { + + if ($this->header) { + $prop = $errorNode->ownerDocument->createElement('s:header'); + $prop->nodeValue = $this->header; + $errorNode->appendChild($prop); + } + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/ReportNotSupported.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/ReportNotSupported.php new file mode 100644 index 000000000..d55c99bd0 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/ReportNotSupported.php @@ -0,0 +1,32 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * ReportNotSupported + * + * This exception is thrown when the client requested an unknown report through the REPORT method + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class ReportNotSupported extends Forbidden { + + /** + * This method allows the exception to include additional information into the WebDAV error response + * + * @param DAV\Server $server + * @param \DOMElement $errorNode + * @return void + */ + public function serialize(DAV\Server $server,\DOMElement $errorNode) { + + $error = $errorNode->ownerDocument->createElementNS('DAV:','d:supported-report'); + $errorNode->appendChild($error); + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/RequestedRangeNotSatisfiable.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/RequestedRangeNotSatisfiable.php new file mode 100644 index 000000000..0a8a85808 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/RequestedRangeNotSatisfiable.php @@ -0,0 +1,31 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * RequestedRangeNotSatisfiable + * + * This exception is normally thrown when the user + * request a range that is out of the entity bounds. + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class RequestedRangeNotSatisfiable extends DAV\Exception { + + /** + * returns the http statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 416; + + } + +} + diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/ServiceUnavailable.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/ServiceUnavailable.php new file mode 100644 index 000000000..dca764899 --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/ServiceUnavailable.php @@ -0,0 +1,30 @@ +<?php + +namespace Sabre\DAV\Exception; + +use Sabre\DAV; + +/** + * ServiceUnavailable + * + * This exception is thrown in case the service + * is currently not available (e.g. down for maintenance). + * + * @author Thomas Müller <thomas.mueller@tmit.eu> + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class ServiceUnavailable extends DAV\Exception { + + /** + * Returns the HTTP statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 503; + + } + +} diff --git a/vendor/sabre/dav/lib/Sabre/DAV/Exception/UnsupportedMediaType.php b/vendor/sabre/dav/lib/Sabre/DAV/Exception/UnsupportedMediaType.php new file mode 100644 index 000000000..38f5a9fac --- /dev/null +++ b/vendor/sabre/dav/lib/Sabre/DAV/Exception/UnsupportedMediaType.php @@ -0,0 +1,28 @@ +<?php + +namespace Sabre\DAV\Exception; + +/** + * 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 + * + * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). + * @author Evert Pot (http://evertpot.com/) + * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License + */ +class UnsupportedMediaType extends \Sabre\DAV\Exception { + + /** + * returns the http statuscode for this exception + * + * @return int + */ + public function getHTTPCode() { + + return 415; + + } + +} |