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