*/
@Override
protected void service( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException
{
WebdavRequest webdavRequest = new WebdavRequestImpl( request, getLocatorFactory() );
// DeltaV requires 'Cache-Control' header for all methods except 'VERSION-CONTROL' and 'REPORT'.
int methodCode = DavMethods.getMethodCode( request.getMethod() );
boolean noCache = DavMethods.isDeltaVMethod( webdavRequest ) && !( DavMethods.DAV_VERSION_CONTROL == methodCode
|| DavMethods.DAV_REPORT == methodCode );
WebdavResponse webdavResponse = new WebdavResponseImpl( response, noCache );
DavResource resource = null;
try
{
// make sure there is a authenticated user
if ( !getDavSessionProvider().attachSession( webdavRequest ) )
{
return;
}
// check matching if=header for lock-token relevant operations
resource =
getResourceFactory().createResource( webdavRequest.getRequestLocator(), webdavRequest, webdavResponse );
if ( !isPreconditionValid( webdavRequest, resource ) )
{
webdavResponse.sendError( DavServletResponse.SC_PRECONDITION_FAILED );
return;