1 /* 2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.net.httpserver; 27 28 class Code { 29 30 public static final int HTTP_CONTINUE = 100; 31 public static final int HTTP_OK = 200; 32 public static final int HTTP_CREATED = 201; 33 public static final int HTTP_ACCEPTED = 202; 34 public static final int HTTP_NOT_AUTHORITATIVE = 203; 35 public static final int HTTP_NO_CONTENT = 204; 36 public static final int HTTP_RESET = 205; 37 public static final int HTTP_PARTIAL = 206; 38 public static final int HTTP_MULT_CHOICE = 300; 39 public static final int HTTP_MOVED_PERM = 301; 40 public static final int HTTP_MOVED_TEMP = 302; 41 public static final int HTTP_SEE_OTHER = 303; 42 public static final int HTTP_NOT_MODIFIED = 304; 43 public static final int HTTP_USE_PROXY = 305; 44 public static final int HTTP_BAD_REQUEST = 400; 45 public static final int HTTP_UNAUTHORIZED = 401; 46 public static final int HTTP_PAYMENT_REQUIRED = 402; 47 public static final int HTTP_FORBIDDEN = 403; 48 public static final int HTTP_NOT_FOUND = 404; 49 public static final int HTTP_BAD_METHOD = 405; 50 public static final int HTTP_NOT_ACCEPTABLE = 406; 51 public static final int HTTP_PROXY_AUTH = 407; 52 public static final int HTTP_CLIENT_TIMEOUT = 408; 53 public static final int HTTP_CONFLICT = 409; 54 public static final int HTTP_GONE = 410; 55 public static final int HTTP_LENGTH_REQUIRED = 411; 56 public static final int HTTP_PRECON_FAILED = 412; 57 public static final int HTTP_ENTITY_TOO_LARGE = 413; 58 public static final int HTTP_REQ_TOO_LONG = 414; 59 public static final int HTTP_UNSUPPORTED_TYPE = 415; 60 public static final int HTTP_INTERNAL_ERROR = 500; 61 public static final int HTTP_NOT_IMPLEMENTED = 501; 62 public static final int HTTP_BAD_GATEWAY = 502; 63 public static final int HTTP_UNAVAILABLE = 503; 64 public static final int HTTP_GATEWAY_TIMEOUT = 504; 65 public static final int HTTP_VERSION = 505; 66 67 static String msg (int code) { 68 69 switch (code) { 70 case HTTP_OK: return " OK"; 71 case HTTP_CONTINUE: return " Continue"; 72 case HTTP_CREATED: return " Created"; 73 case HTTP_ACCEPTED: return " Accepted"; 74 case HTTP_NOT_AUTHORITATIVE: return " Non-Authoritative Information"; 75 case HTTP_NO_CONTENT: return " No Content"; 76 case HTTP_RESET: return " Reset Content"; 77 case HTTP_PARTIAL: return " Partial Content"; 78 case HTTP_MULT_CHOICE: return " Multiple Choices"; 79 case HTTP_MOVED_PERM: return " Moved Permanently"; 80 case HTTP_MOVED_TEMP: return " Temporary Redirect"; 81 case HTTP_SEE_OTHER: return " See Other"; 82 case HTTP_NOT_MODIFIED: return " Not Modified"; 83 case HTTP_USE_PROXY: return " Use Proxy"; 84 case HTTP_BAD_REQUEST: return " Bad Request"; 85 case HTTP_UNAUTHORIZED: return " Unauthorized" ; 86 case HTTP_PAYMENT_REQUIRED: return " Payment Required"; 87 case HTTP_FORBIDDEN: return " Forbidden"; 88 case HTTP_NOT_FOUND: return " Not Found"; 89 case HTTP_BAD_METHOD: return " Method Not Allowed"; 90 case HTTP_NOT_ACCEPTABLE: return " Not Acceptable"; 91 case HTTP_PROXY_AUTH: return " Proxy Authentication Required"; 92 case HTTP_CLIENT_TIMEOUT: return " Request Time-Out"; 93 case HTTP_CONFLICT: return " Conflict"; 94 case HTTP_GONE: return " Gone"; 95 case HTTP_LENGTH_REQUIRED: return " Length Required"; 96 case HTTP_PRECON_FAILED: return " Precondition Failed"; 97 case HTTP_ENTITY_TOO_LARGE: return " Request Entity Too Large"; 98 case HTTP_REQ_TOO_LONG: return " Request-URI Too Large"; 99 case HTTP_UNSUPPORTED_TYPE: return " Unsupported Media Type"; 100 case HTTP_INTERNAL_ERROR: return " Internal Server Error"; 101 case HTTP_NOT_IMPLEMENTED: return " Not Implemented"; 102 case HTTP_BAD_GATEWAY: return " Bad Gateway"; 103 case HTTP_UNAVAILABLE: return " Service Unavailable"; 104 case HTTP_GATEWAY_TIMEOUT: return " Gateway Timeout"; 105 case HTTP_VERSION: return " HTTP Version Not Supported"; 106 default: return ""; 107 } 108 } 109 }