get( $request ); case ( $request instanceof ezcWebdavHeadRequest ): return $this->head( $request ); case ( $request instanceof ezcWebdavPropFindRequest ): return $this->propFind( $request ); case ( $request instanceof ezcWebdavPropPatchRequest ): return $this->propPatch( $request ); case ( $request instanceof ezcWebdavOptionsRequest ): return $this->options( $request ); case ( $request instanceof ezcWebdavDeleteRequest ): if ( $this instanceof ezcWebdavBackendChange ) { return $this->delete( $request ); } else { throw new ezcWebdavRequestNotSupportedException( $request, 'Backend does not implement ezcWebdavBackendChange.' ); } break; case ( $request instanceof ezcWebdavCopyRequest ): if ( $this instanceof ezcWebdavBackendChange ) { return $this->copy( $request ); } else { throw new ezcWebdavRequestNotSupportedException( $request, 'Backend does not implement ezcWebdavBackendChange.' ); } break; case ( $request instanceof ezcWebdavMoveRequest ): if ( $this instanceof ezcWebdavBackendChange ) { return $this->move( $request ); } else { throw new ezcWebdavRequestNotSupportedException( $request, 'Backend does not implement ezcWebdavBackendChange.' ); } break; case ( $request instanceof ezcWebdavMakeCollectionRequest ): if ( $this instanceof ezcWebdavBackendMakeCollection ) { return $this->makeCollection( $request ); } else { throw new ezcWebdavRequestNotSupportedException( $request, 'Backend does not implement ezcWebdavBackendMakeCollection.' ); } break; case ( $request instanceof ezcWebdavPutRequest ): if ( $this instanceof ezcWebdavBackendPut ) { return $this->put( $request ); } else { throw new ezcWebdavRequestNotSupportedException( $request, 'Backend does not implement ezcWebdavBackendPut.' ); } break; default: throw new ezcWebdavRequestNotSupportedException( $request, 'Backend could not dispatch request object.' ); } } /** * Required method to serve GET requests. * * The method receives a {@link ezcWebdavGetRequest} object containing all * relevant information obout the clients request and should either return * an error by returning an {@link ezcWebdavErrorResponse} object, or any * other {@link ezcWebdavResponse} objects. * * @param ezcWebdavGetRequest $request * @return ezcWebdavResponse */ abstract public function get( ezcWebdavGetRequest $request ); /** * Required method to serve HEAD requests. * * The method receives a {@link ezcWebdavHeadRequest} object containing all * relevant information obout the clients request and should either return * an error by returning an {@link ezcWebdavErrorResponse} object, or any other * {@link ezcWebdavResponse} objects. * * @param ezcWebdavGetRequest $request * @return ezcWebdavResponse */ abstract public function head( ezcWebdavHeadRequest $request ); /** * Required method to serve PROPFIND requests. * * The method receives a {@link ezcWebdavPropFindRequest} object containing all * relevant information obout the clients request and should either return * an error by returning an {@link ezcWebdavErrorResponse} object, or any * other {@link ezcWebdavResponse} objects. * * The {@link ezcWebdavPropFindRequest} object contains a definition to * find one or more properties of a given file or collection. * * @param ezcWebdavPropFindRequest $request * @return ezcWebdavResponse */ abstract public function propFind( ezcWebdavPropFindRequest $request ); /** * Required method to serve PROPPATCH requests. * * The method receives a {@link ezcWebdavPropPatchRequest} object containing all * relevant information obout the clients request and should either return * an error by returning an {@link ezcWebdavErrorResponse} object, or any * other {@link ezcWebdavResponse} objects. * * @param ezcWebdavPropPatchRequest $request * @return ezcWebdavResponse */ abstract public function propPatch( ezcWebdavPropPatchRequest $request ); /** * Required method to serve OPTIONS requests. * * The method receives a {@link ezcWebdavOptionsRequest} object containing all * relevant information obout the clients request and should either return * an error by returning an {@link ezcWebdavErrorResponse} object, or any * other {@link ezcWebdavResponse} objects. * * @param ezcWebdavOptionsRequest $request * @return ezcWebdavResponse */ public function options( ezcWebdavOptionsRequest $request ) { $response = new ezcWebdavOptionsResponse( ( $this instanceof ezcWebdavBackendLock) ? '1, 2' : '1' ); // Always allowed $allowed = 'GET, HEAD, PROPFIND, PROPPATCH, OPTIONS, '; // Check if modifications are allowed if ( $this instanceof ezcWebdavBackendChange ) { $allowed .= 'DELETE, COPY, MOVE, '; } // Check if MKCOL is allowed if ( $this instanceof ezcWebdavBackendMakeCollection ) { $allowed .= 'MKCOL, '; } // Check if PUT is allowed if ( $this instanceof ezcWebdavBackendPut ) { $allowed .= 'PUT, '; } // Check if locking is allowed if ( $this instanceof ezcWebdavBackendLock ) { $allowed .= 'LOCK, UNLOCK, '; } $response->setHeader( 'Allow', substr( $allowed, 0, -2 ) ); return $response; } } ?>