|
23 | 23 | *
|
24 | 24 | * @author Arjen Poutsma
|
25 | 25 | * @see HttpStatus.Series
|
| 26 | + * @see <a href="http://www.iana.org/assignments/http-status-codes">HTTP Status Code Registry</a> |
26 | 27 | */
|
27 | 28 | public enum HttpStatus {
|
28 | 29 |
|
29 | 30 | // 1xx Informational
|
30 | 31 |
|
| 32 | + /** |
| 33 | + * {@code 100 Continue}. |
| 34 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.1.1">HTTP/1.1</a> |
| 35 | + */ |
31 | 36 | CONTINUE(100),
|
| 37 | + /** |
| 38 | + * {@code 101 Switching Protocols}. |
| 39 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.1.2">HTTP/1.1</a> |
| 40 | + */ |
32 | 41 | SWITCHING_PROTOCOLS(101),
|
| 42 | + /** |
| 43 | + * {@code 102 Processing}. |
| 44 | + * @see <a href="http://tools.ietf.org/html/rfc2518#section-10.1">WebDAV</a> |
| 45 | + */ |
| 46 | + PROCESSING(102), |
33 | 47 |
|
34 | 48 | // 2xx Success
|
35 | 49 |
|
| 50 | + /** |
| 51 | + * {@code 200 OK}. |
| 52 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.2.1">HTTP/1.1</a> |
| 53 | + */ |
36 | 54 | OK(200),
|
| 55 | + /** |
| 56 | + * {@code 201 Created}. |
| 57 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.2.2">HTTP/1.1</a> |
| 58 | + */ |
37 | 59 | CREATED(201),
|
| 60 | + /** |
| 61 | + * {@code 202 Accepted}. |
| 62 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.2.3">HTTP/1.1</a> |
| 63 | + */ |
38 | 64 | ACCEPTED(202),
|
| 65 | + /** |
| 66 | + * {@code 203 Non-Authoritative Information}. |
| 67 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.2.4">HTTP/1.1</a> |
| 68 | + */ |
39 | 69 | NON_AUTHORITATIVE_INFORMATION(203),
|
| 70 | + /** |
| 71 | + * {@code 204 No Content}. |
| 72 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.2.5">HTTP/1.1</a> |
| 73 | + */ |
40 | 74 | NO_CONTENT(204),
|
| 75 | + /** |
| 76 | + * {@code 205 Reset Content}. |
| 77 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.2.6">HTTP/1.1</a> |
| 78 | + */ |
41 | 79 | RESET_CONTENT(205),
|
| 80 | + /** |
| 81 | + * {@code 206 Partial Content}. |
| 82 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.2.7">HTTP/1.1</a> |
| 83 | + */ |
42 | 84 | PARTIAL_CONTENT(206),
|
| 85 | + /** |
| 86 | + * {@code 207 Multi-Status}. |
| 87 | + * @see <a href="http://tools.ietf.org/html/rfc4918#section-13">WebDAV</a> |
| 88 | + */ |
| 89 | + MULTI_STATUS(207), |
| 90 | + /** |
| 91 | + * {@code 208 Already Reported}. |
| 92 | + * @see <a href="http://tools.ietf.org/html/draft-ietf-webdav-bind-27#section-7.1">WebDAV Binding Extensions</a> |
| 93 | + */ |
| 94 | + ALREADY_REPORTED(208), |
| 95 | + /** |
| 96 | + * {@code 226 IM Used}. |
| 97 | + * @see <a href="http://tools.ietf.org/html/rfc3229#section-10.4.1">Delta encoding in HTTP</a> |
| 98 | + */ |
| 99 | + IM_USED(226), |
43 | 100 |
|
44 | 101 | // 3xx Redirection
|
45 | 102 |
|
| 103 | + /** |
| 104 | + * {@code 300 Multiple Choices}. |
| 105 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.3.1">HTTP/1.1</a> |
| 106 | + */ |
46 | 107 | MULTIPLE_CHOICES(300),
|
| 108 | + /** |
| 109 | + * {@code 301 Moved Permanently}. |
| 110 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.3.2">HTTP/1.1</a> |
| 111 | + */ |
47 | 112 | MOVED_PERMANENTLY(301),
|
| 113 | + /** |
| 114 | + * {@code 302 Found}. |
| 115 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.3.3">HTTP/1.1</a> |
| 116 | + */ |
| 117 | + FOUND(302), |
| 118 | + /** |
| 119 | + * {@code 302 Moved Temporarily}. |
| 120 | + * @see <a href="http://tools.ietf.org/html/rfc1945#section-9.3">HTTP/1.0</a> |
| 121 | + */ |
48 | 122 | MOVED_TEMPORARILY(302),
|
| 123 | + /** |
| 124 | + * {@code 303 See Other}. |
| 125 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.3.4">HTTP/1.1</a> |
| 126 | + */ |
49 | 127 | SEE_OTHER(303),
|
| 128 | + /** |
| 129 | + * {@code 304 Not Modified}. |
| 130 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.3.5">HTTP/1.1</a> |
| 131 | + */ |
50 | 132 | NOT_MODIFIED(304),
|
| 133 | + /** |
| 134 | + * {@code 305 Use Proxy}. |
| 135 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.3.6">HTTP/1.1</a> |
| 136 | + */ |
51 | 137 | USE_PROXY(305),
|
| 138 | + /** |
| 139 | + * {@code 307 Temporary Redirect}. |
| 140 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.3.8">HTTP/1.1</a> |
| 141 | + */ |
52 | 142 | TEMPORARY_REDIRECT(307),
|
53 | 143 |
|
54 | 144 | // --- 4xx Client Error ---
|
55 | 145 |
|
| 146 | + /** |
| 147 | + * {@code 400 Bad Request}. |
| 148 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.1">HTTP/1.1</a> |
| 149 | + */ |
56 | 150 | BAD_REQUEST(400),
|
| 151 | + /** |
| 152 | + * {@code 401 Unauthorized}. |
| 153 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.2">HTTP/1.1</a> |
| 154 | + */ |
57 | 155 | UNAUTHORIZED(401),
|
| 156 | + /** |
| 157 | + * {@code 402 Payment Required}. |
| 158 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.3">HTTP/1.1</a> |
| 159 | + */ |
58 | 160 | PAYMENT_REQUIRED(402),
|
| 161 | + /** |
| 162 | + * {@code 403 Forbidden}. |
| 163 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.4">HTTP/1.1</a> |
| 164 | + */ |
59 | 165 | FORBIDDEN(403),
|
| 166 | + /** |
| 167 | + * {@code 404 Not Found}. |
| 168 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.5">HTTP/1.1</a> |
| 169 | + */ |
60 | 170 | NOT_FOUND(404),
|
| 171 | + /** |
| 172 | + * {@code 405 Method Not Allowed}. |
| 173 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.6">HTTP/1.1</a> |
| 174 | + */ |
61 | 175 | METHOD_NOT_ALLOWED(405),
|
| 176 | + /** |
| 177 | + * {@code 406 Not Acceptable}. |
| 178 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.7">HTTP/1.1</a> |
| 179 | + */ |
62 | 180 | NOT_ACCEPTABLE(406),
|
| 181 | + /** |
| 182 | + * {@code 407 Proxy Authentication Required}. |
| 183 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.8">HTTP/1.1</a> |
| 184 | + */ |
63 | 185 | PROXY_AUTHENTICATION_REQUIRED(407),
|
| 186 | + /** |
| 187 | + * {@code 408 Request Timeout}. |
| 188 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.9">HTTP/1.1</a> |
| 189 | + */ |
64 | 190 | REQUEST_TIMEOUT(408),
|
| 191 | + /** |
| 192 | + * {@code 409 Conflict}. |
| 193 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.10">HTTP/1.1</a> |
| 194 | + */ |
65 | 195 | CONFLICT(409),
|
| 196 | + /** |
| 197 | + * {@code 410 Gone}. |
| 198 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.11">HTTP/1.1</a> |
| 199 | + */ |
66 | 200 | GONE(410),
|
| 201 | + /** |
| 202 | + * {@code 411 Length Required}. |
| 203 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.12">HTTP/1.1</a> |
| 204 | + */ |
67 | 205 | LENGTH_REQUIRED(411),
|
| 206 | + /** |
| 207 | + * {@code 412 Precondition failed}. |
| 208 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.13">HTTP/1.1</a> |
| 209 | + */ |
68 | 210 | PRECONDITION_FAILED(412),
|
69 |
| - REQUEST_TOO_LONG(413), |
| 211 | + /** |
| 212 | + * {@code 413 Request Entity Too Large}. |
| 213 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.14">HTTP/1.1</a> |
| 214 | + */ |
| 215 | + REQUEST_ENTITY_TOO_LARGE(413), |
| 216 | + /** |
| 217 | + * {@code 414 Request-URI Too Long}. |
| 218 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.15">HTTP/1.1</a> |
| 219 | + */ |
70 | 220 | REQUEST_URI_TOO_LONG(414),
|
| 221 | + /** |
| 222 | + * {@code 415 Unsupported Media Type}. |
| 223 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.16">HTTP/1.1</a> |
| 224 | + */ |
71 | 225 | UNSUPPORTED_MEDIA_TYPE(415),
|
| 226 | + /** |
| 227 | + * {@code 416 Requested Range Not Satisfiable}. |
| 228 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.17">HTTP/1.1</a> |
| 229 | + */ |
72 | 230 | REQUESTED_RANGE_NOT_SATISFIABLE(416),
|
| 231 | + /** |
| 232 | + * {@code 417 Expectation Failed}. |
| 233 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.4.18">HTTP/1.1</a> |
| 234 | + */ |
73 | 235 | EXPECTATION_FAILED(417),
|
| 236 | + /** |
| 237 | + * {@code 419 Insufficient Space on Resource}. |
| 238 | + * @see <a href="http://tools.ietf.org/html/draft-ietf-webdav-protocol-05#section-10.4">WebDAV Draft</a> |
| 239 | + */ |
| 240 | + INSUFFICIENT_SPACE_ON_RESOURCE(419), |
| 241 | + /** |
| 242 | + * {@code 420 Method Failure}. |
| 243 | + * @see <a href="http://tools.ietf.org/html/draft-ietf-webdav-protocol-05#section-10.5">WebDAV Draft</a> |
| 244 | + */ |
| 245 | + METHOD_FAILURE(420), |
| 246 | + /** |
| 247 | + * {@code 421 Destination Locked}. |
| 248 | + * @see <a href="http://tools.ietf.org/html/draft-ietf-webdav-protocol-05#section-10.6">WebDAV Draft</a> |
| 249 | + */ |
| 250 | + DESTINATION_LOCKED(421), |
| 251 | + /** |
| 252 | + * {@code 422 Unprocessable Entity}. |
| 253 | + * @see <a href="http://tools.ietf.org/html/rfc4918#section-11.2">WebDAV</a> |
| 254 | + */ |
| 255 | + UNPROCESSABLE_ENTITY(422), |
| 256 | + /** |
| 257 | + * {@code 423 Locked}. |
| 258 | + * @see <a href="http://tools.ietf.org/html/rfc4918#section-11.3">WebDAV</a> |
| 259 | + */ |
| 260 | + LOCKED(423), |
| 261 | + /** |
| 262 | + * {@code 424 Failed Dependency}. |
| 263 | + * @see <a href="http://tools.ietf.org/html/rfc4918#section-11.4">WebDAV</a> |
| 264 | + */ |
| 265 | + FAILED_DEPENDENCY(424), |
| 266 | + /** |
| 267 | + * {@code 426 Upgrade Required}. |
| 268 | + * @see <a href="http://tools.ietf.org/html/rfc2817#section-6">Upgrading to TLS Within HTTP/1.1</a> |
| 269 | + */ |
| 270 | + UPGRADE_REQUIRED(426), |
74 | 271 |
|
75 | 272 | // --- 5xx Server Error ---
|
76 | 273 |
|
| 274 | + /** |
| 275 | + * {@code 500 Internal Server Error}. |
| 276 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.5.1">HTTP/1.1</a> |
| 277 | + */ |
77 | 278 | INTERNAL_SERVER_ERROR(500),
|
| 279 | + /** |
| 280 | + * {@code 501 Not Implemented}. |
| 281 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.5.2">HTTP/1.1</a> |
| 282 | + */ |
78 | 283 | NOT_IMPLEMENTED(501),
|
| 284 | + /** |
| 285 | + * {@code 502 Bad Gateway}. |
| 286 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.5.3">HTTP/1.1</a> |
| 287 | + */ |
79 | 288 | BAD_GATEWAY(502),
|
| 289 | + /** |
| 290 | + * {@code 503 Service Unavailable}. |
| 291 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.5.4">HTTP/1.1</a> |
| 292 | + */ |
80 | 293 | SERVICE_UNAVAILABLE(503),
|
| 294 | + /** |
| 295 | + * {@code 504 Gateway Timeout}. |
| 296 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.5.5">HTTP/1.1</a> |
| 297 | + */ |
81 | 298 | GATEWAY_TIMEOUT(504),
|
82 |
| - HTTP_VERSION_NOT_SUPPORTED(505); |
| 299 | + /** |
| 300 | + * {@code 505 HTTP Version Not Supported}. |
| 301 | + * @see <a href="http://tools.ietf.org/html/rfc2616#section-10.5.6">HTTP/1.1</a> |
| 302 | + */ |
| 303 | + HTTP_VERSION_NOT_SUPPORTED(505), |
| 304 | + /** |
| 305 | + * {@code 506 Variant Also Negotiates} |
| 306 | + * @see <a href="http://tools.ietf.org/html/rfc2295#section-8.1">Transparent Content Negotiation</a> |
| 307 | + */ |
| 308 | + VARIANT_ALSO_NEGOTIATES(506), |
| 309 | + /** |
| 310 | + * {@code 507 Insufficient Storage} |
| 311 | + * @see <a href="http://tools.ietf.org/html/rfc4918#section-11.5">WebDAV</a> |
| 312 | + */ |
| 313 | + INSUFFICIENT_STORAGE(507), |
| 314 | + /** |
| 315 | + * {@code 508 Loop Detected} |
| 316 | + * @see <a href="http://tools.ietf.org/html/draft-ietf-webdav-bind-27#section-7.2">WebDAV Binding Extensions</a> |
| 317 | + */ |
| 318 | + LOOP_DETECTED(508), |
| 319 | + /** |
| 320 | + * {@code 510 Not Extended} |
| 321 | + * @see <a href="http://tools.ietf.org/html/rfc2774#section-7">HTTP Extension Framework</a> |
| 322 | + */ |
| 323 | + NOT_EXTENDED(510); |
83 | 324 |
|
84 | 325 |
|
85 | 326 | private final int value;
|
|
0 commit comments