in = value.getContent();
Request request = Request.valueOf(in);
Method method = request.getMethod();
Response response = null;
switch (method) {
case PUT:
response = handlePut(src, key, request, in);
break;
case GET:
response = handleGet(src, key, request, in);
break;
case DELETE:
response = handleDelete(src, key, request, in);
break;
case HEAD:
response = handleHead(src, key, request, in);
break;
default:
throw new IllegalArgumentException("method=" + method);
}
if (response == null) {
throw new IllegalStateException();
}
return response.commit();
} catch (Exception err) {
LOG.error("Exception", err);
return ResponseFactory.commit(ResponseFactory.error(err));
} finally {