1 31 32 package org.apache.commons.httpclient; 33 34 import java.io.IOException ; 35 36 46 public class URIException extends IOException { 47 48 50 53 public URIException() { 54 } 55 56 57 62 public URIException(int reasonCode) { 63 setReasonCode(reasonCode); 64 } 65 66 67 73 public URIException(int reasonCode, String reason) { 74 super(reason); this.reason = reason; 76 setReasonCode(reasonCode); 77 } 78 79 80 85 public URIException(String reason) { 86 super(reason); this.reason = reason; 88 setReasonCode(UNKNOWN); 89 } 90 91 93 96 public static final int UNKNOWN = 0; 97 98 99 102 public static final int PARSING = 1; 103 104 105 108 public static final int UNSUPPORTED_ENCODING = 2; 109 110 111 114 public static final int ESCAPING = 3; 115 116 117 120 public static final int PUNYCODE = 4; 121 122 124 127 protected int reasonCode; 128 129 130 133 protected String reason; 134 135 137 142 public int getReasonCode() { 143 return reasonCode; 144 } 145 146 147 152 public void setReasonCode(int reasonCode) { 153 this.reasonCode = reasonCode; 154 } 155 156 157 162 public String getReason() { 163 return reason; 164 } 165 166 167 172 public void setReason(String reason) { 173 this.reason = reason; 174 } 175 176 177 } 178 179 | Popular Tags |