this.controller = controller;
}
@Override
public void handle(Request request, Response response) {
Method met = request.getMethod();
try {
if (met.equals(Method.GET)) {
doGet(request, response);
} else {
// These modify layers, so we reload afterwards
if (met.equals(Method.POST)) {
doPost(request, response);
} else if (met.equals(Method.PUT)) {
doPut(request, response);
} else if (met.equals(Method.DELETE)) {
doDelete(request, response);
} else {
throw new RestletException("Method not allowed",
Status.CLIENT_ERROR_METHOD_NOT_ALLOWED);
}