コード例 #1
0
 /**
  * @param resource
  * @param response
  * @param message - optional message to output in the body content
  */
 @Override
 public void respondConflict(
     Resource resource, Response response, Request request, String message) {
   log.debug("respondConflict");
   response.setStatus(Response.Status.SC_CONFLICT);
   contentGenerator.generate(resource, request, response, Status.SC_CONFLICT);
 }
コード例 #2
0
 @Override
 public void respondMethodNotAllowed(Resource res, Response response, Request request) {
   log.debug(
       "method not allowed. handler: "
           + this.getClass().getName()
           + " resource: "
           + res.getClass().getName());
   response.setStatus(Response.Status.SC_METHOD_NOT_ALLOWED);
   contentGenerator.generate(res, request, response, Status.SC_METHOD_NOT_ALLOWED);
 }
コード例 #3
0
 @Override
 public void respondServerError(Request request, Response response, String reason) {
   response.setStatus(Status.SC_INTERNAL_SERVER_ERROR);
   contentGenerator.generate(null, request, response, Status.SC_INTERNAL_SERVER_ERROR);
 }
コード例 #4
0
 @Override
 public void respondMethodNotImplemented(Resource resource, Response response, Request request) {
   response.setStatus(Response.Status.SC_NOT_IMPLEMENTED);
   contentGenerator.generate(resource, request, response, Status.SC_NOT_IMPLEMENTED);
 }
コード例 #5
0
 @Override
 public void respondNotFound(Response response, Request request) {
   response.setStatus(Response.Status.SC_NOT_FOUND);
   response.setContentTypeHeader("text/html");
   contentGenerator.generate(null, request, response, Status.SC_NOT_FOUND);
 }