'Handle HTTP DELETE request.'

@public
@timing_stats()
def DELETE(self, req):

    (drive, part, account, container, obj) = split_and_validate_path(req, 4, 5, True)
    req_timestamp = valid_timestamp(req)
    if (self.mount_check and (not check_mount(self.root, drive))):
        return HTTPInsufficientStorage(drive=drive, request=req)
    obj_policy_index = (self.get_and_validate_policy_index(req) or 0)
    broker = self._get_container_broker(drive, part, account, container)
    if (account.startswith(self.auto_create_account_prefix) and obj and (not os.path.exists(broker.db_file))):
        try:
            broker.initialize(req_timestamp.internal, obj_policy_index)
        except DatabaseAlreadyExists:
            pass
    if (not os.path.exists(broker.db_file)):
        return HTTPNotFound()
    if obj:
        broker.delete_object(obj, req.headers.get('x-timestamp'), obj_policy_index)
        return HTTPNoContent(request=req)
    else:
        if (not broker.empty()):
            return HTTPConflict(request=req)
        existed = (Timestamp(broker.get_info()['put_timestamp']) and (not broker.is_deleted()))
        broker.delete_db(req_timestamp.internal)
        if (not broker.is_deleted()):
            return HTTPConflict(request=req)
        self._update_sync_store(broker, 'DELETE')
        resp = self.account_update(req, account, container, broker)
        if resp:
            return resp
        if existed:
            return HTTPNoContent(request=req)
        return HTTPNotFound()
