Path

ez components / documentation / api reference / 2007.2alpha1 / webdav


eZ Components 2007.2alpha1

Webdav: ezcWebdavResponse

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcWebdavResponse

Base class for all response objects. [source]
This base class must be extended by all response representation classes.

Descendents

Child Class Description
ezcWebdavPutResponse Class representing a response on a PUT request.
ezcWebdavMakeCollectionResponse Class representing a response on a MKCOL request.
ezcWebdavPropStatResponse Class used to answer GET responses on a collection by the webdav backend.
ezcWebdavOptionsResponse Class used to answer OPTIONS responses on a resource by the webdav backend.
ezcWebdavMultistatusResponse Class for multistatus responses, aggregating other responses.
ezcWebdavGetCollectionResponse Class used to answer GET responses on a collection by the webdav backend.
ezcWebdavCopyResponse Class for copy responses.
ezcWebdavGetResourceResponse Class used to answer GET responses on a resource by the webdav backend.
ezcWebdavPropFindResponse Class used to answer propfind responses on a collection by the webdav backend.
ezcWebdavDeleteResponse Class representing a response on a delete request.
ezcWebdavHeadResponse Class used to answer GET responses on a resource by the webdav backend.
ezcWebdavErrorResponse Base class for all response objects.

Constants

STATUS_100 = 100 Response status codes
STATUS_101 = 101
STATUS_200 = 200
STATUS_201 = 201
STATUS_202 = 202
STATUS_203 = 203
STATUS_204 = 204
STATUS_205 = 205
STATUS_206 = 206
STATUS_207 = 207
STATUS_300 = 300
STATUS_301 = 301
STATUS_302 = 302
STATUS_303 = 303
STATUS_304 = 304
STATUS_305 = 305
STATUS_400 = 400
STATUS_401 = 401
STATUS_402 = 402
STATUS_403 = 403
STATUS_404 = 404
STATUS_405 = 405
STATUS_406 = 406
STATUS_407 = 407
STATUS_408 = 408
STATUS_409 = 409
STATUS_410 = 410
STATUS_411 = 411
STATUS_412 = 412
STATUS_413 = 413
STATUS_414 = 414
STATUS_415 = 415
STATUS_423 = 423
STATUS_424 = 424
STATUS_500 = 500
STATUS_501 = 501
STATUS_502 = 502
STATUS_503 = 503
STATUS_504 = 504
STATUS_505 = 505
STATUS_507 = 507

Properties

string read/write  $responseDescription
Optional user readable response description.
int read/write  $status
Response status code.

Member Variables

public array $errorNames = array(
self::STATUS_100 => 'Continue',
self::STATUS_101 => 'Switching Protocols',

self::STATUS_200 => 'OK',
self::STATUS_201 => 'Created',
self::STATUS_202 => 'Accepted',
self::STATUS_203 => 'Non-Authoritative Information',
self::STATUS_204 => 'No Content',
self::STATUS_205 => 'Reset Content',
self::STATUS_206 => 'Partial Content',
self::STATUS_207 => 'Multi-Status',

self::STATUS_300 => 'Multiple Choices',
self::STATUS_301 => 'Moved Permanently',
self::STATUS_302 => 'Moved Temporarily',
self::STATUS_303 => 'See Other',
self::STATUS_304 => 'Not Modified',
self::STATUS_305 => 'Use Proxy',

self::STATUS_400 => 'Bad Request',
self::STATUS_401 => 'Unauthorized',
self::STATUS_402 => 'Payment Required',
self::STATUS_403 => 'Forbidden',
self::STATUS_404 => 'Not Found',
self::STATUS_405 => 'Method Not Allowed',
self::STATUS_406 => 'Not Acceptable',
self::STATUS_407 => 'Proxy Authentication Required',
self::STATUS_408 => 'Request Time-out',
self::STATUS_409 => 'Conflict',
self::STATUS_410 => 'Gone',
self::STATUS_411 => 'Length Required',
self::STATUS_412 => 'Precondition Failed',
self::STATUS_413 => 'Request Entity Too Large',
self::STATUS_414 => 'Request-URI Too Large',
self::STATUS_415 => 'Unsupported Media Type',
self::STATUS_423 => 'Locked',
self::STATUS_424 => 'Failed Dependency',

self::STATUS_500 => 'Internal Server Error',
self::STATUS_501 => 'Not Implemented',
self::STATUS_502 => 'Bad Gateway',
self::STATUS_503 => 'Service Unavailable',
self::STATUS_504 => 'Gateway Time-out',
self::STATUS_505 => 'HTTP Version not supported',
self::STATUS_507 => 'Insufficient Storage',
)

User readable names for error status codes
protected array(string=>mixed) $headers = array()
Container for header information.
protected array(string=>mixed) $properties = array(
'responseDescription' => null,
)

Container to hold the properties

Method Summary

public mixed getHeader( $headerName )
Returns the contents of a specific header.
public array(string=>string) getHeaders( )
Returns all headers.
public void setHeader( $headerName, $headerValue )
Sets a header to a specified value.
public void __construct( [$status = self::STATUS_200] )
Construct error response from status.
public void validateHeaders( )
Validates the headers set in this request.
public string __toString( )
Return valid HTTP response string from error code.

Methods

getHeader

mixed getHeader( string $headerName )
Returns the contents of a specific header.
Returns the content of the header identified with $headerName with the given name and null if no content for the header is available.

Parameters

Name Type Description
$headerName string  

getHeaders

array(string=>string) getHeaders( )
Returns all headers.

setHeader

void setHeader( string $headerName, mixed $headerValue )
Sets a header to a specified value.
Sets the value for $header to $headerValue. All processable headers will be validated centrally in validateHeaders().
For validation of header content, the method validateHeaders() can be overwritten.

Parameters

Name Type Description
$headerName string  
$headerValue mixed  

__construct

void __construct( [int $status = self::STATUS_200] )
Construct error response from status.

Parameters

Name Type Description
$status int  

Redefined in descendants as

Method Description
ezcWebdavPutResponse::__construct() Construct put response.
ezcWebdavMakeCollectionResponse::__construct() Construct mkcol response.
ezcWebdavPropStatResponse::__construct() Construct prop stat response.
ezcWebdavOptionsResponse::__construct() Construct options response.
ezcWebdavMultistatusResponse::__construct() Construct multistatus from any number of requests, provided either in arrays with requests or directly as constructor parameters.
ezcWebdavGetCollectionResponse::__construct() Construct error response from status and requested URI.
ezcWebdavCopyResponse::__construct() Construct copy response including an idicator, wheather contents have been replaced or not. The response code in the transport handler depends on this.
ezcWebdavGetResourceResponse::__construct() Construct error response from status and requested URI.
ezcWebdavPropFindResponse::__construct() Construct a propfind response.
ezcWebdavDeleteResponse::__construct() Construct delete response.
ezcWebdavHeadResponse::__construct() Construct head response.
ezcWebdavErrorResponse::__construct() Construct error response from status and requested URI.

validateHeaders

void validateHeaders( )
Validates the headers set in this request.
This method is called by ezcWebdavServer after the response object has been created by an ezcWebdavBackend. It must validate all headers specific for this request for existance of required headers and validity of all headers used by the specific request implementation. The call of the parent method is *mandatory* to have common WebDAV and HTTP headers validated, too!

Throws

ClassDescription
ezcWebdavMissingHeaderException if a required header is missing.
ezcWebdavInvalidHeaderException if a header is present, but its content does not validate.

Redefined in descendants as

Method Description
ezcWebdavOptionsResponse::validateHeaders() Validates the headers set in this request.
ezcWebdavMultistatusResponse::validateHeaders() Validates the headers set in this request.

__toString

string __toString( )
Return valid HTTP response string from error code.

Last updated: Mon, 12 Nov 2007