01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.http.server;
07:
08: /**
09: * HTTP-related exception that includes the relevant HTTP status code.
10: *
11: * @author Arjohn Kampman
12: */
13: public class HTTPException extends Exception {
14:
15: private static final long serialVersionUID = 1356463348553827230L;
16:
17: private int statusCode;
18:
19: public HTTPException(int statusCode) {
20: super ();
21: setStatusCode(statusCode);
22: }
23:
24: public HTTPException(int statusCode, String message) {
25: super (message);
26: setStatusCode(statusCode);
27: }
28:
29: public HTTPException(int statusCode, String message, Throwable t) {
30: super (message, t);
31: setStatusCode(statusCode);
32: }
33:
34: public HTTPException(int statusCode, Throwable t) {
35: super (t);
36: setStatusCode(statusCode);
37: }
38:
39: public final int getStatusCode() {
40: return statusCode;
41: }
42:
43: protected void setStatusCode(int statusCode) {
44: this.statusCode = statusCode;
45: }
46: }
|