1 16 package org.mortbay.http; 17 import java.io.IOException ; 18 19 import org.mortbay.util.TypeUtil; 20 21 22 23 28 public class HttpException extends IOException 29 { 30 private int _code; 31 32 public int getCode() 33 { 34 return _code; 35 } 36 37 public String getReason() 38 { 39 return (String )HttpResponse.__statusMsg.get(TypeUtil.newInteger(_code)); 40 } 41 42 public HttpException() 43 { 44 _code=HttpResponse.__400_Bad_Request ; 45 } 46 47 public HttpException(int code) 48 { 49 _code=code; 50 } 51 52 public HttpException(int code, String message) 53 { 54 super(message); 55 _code=code; 56 } 57 58 public String toString() 59 { 60 String message=getMessage(); 61 String reason=getReason(); 62 return "HttpException("+_code+","+reason+","+message+")"; 63 } 64 } 65 66 | Popular Tags |