Sends a 404 error page to the client. Handles responses from deprecated API calls
()
| 437 | * Handles responses from deprecated API calls |
| 438 | */ |
| 439 | @Override |
| 440 | public void notFound() { |
| 441 | logWarn("Not Found: " + request().getUri()); |
| 442 | if (this.api_version > 0) { |
| 443 | // always default to the latest version of the error formatter since we |
| 444 | // need to return something |
| 445 | switch (this.api_version) { |
| 446 | case 1: |
| 447 | default: |
| 448 | sendReply(HttpResponseStatus.NOT_FOUND, serializer.formatNotFoundV1()); |
| 449 | } |
| 450 | return; |
| 451 | } |
| 452 | if (hasQueryStringParam("json")) { |
| 453 | sendReply(HttpResponseStatus.NOT_FOUND, |
| 454 | new StringBuilder("{\"err\":\"Page Not Found\"}")); |
| 455 | } else { |
| 456 | sendReply(HttpResponseStatus.NOT_FOUND, PAGE_NOT_FOUND); |
| 457 | } |
| 458 | } |
| 459 | |
| 460 | /** Redirects the client's browser to the given location. */ |
| 461 | public void redirect(final String location) { |