1 16 package org.apache.axis2.transport.http; 17 18 import java.io.UnsupportedEncodingException ; 19 20 23 public class HTTPConstants { 24 25 public static final String PROTOCOL_VERSION = "PROTOCOL"; 26 27 30 public static final String REQUEST_URI = "REQUEST_URI"; 31 32 35 public static final String RESPONSE_CODE = "RESPONSE_CODE"; 36 37 40 public static final String RESPONSE_WORD = "RESPONSE_WORD"; 41 42 45 public static final String RESPONSE_ACK_CODE_VAL = "202"; 46 47 50 public static final String SOCKET = "SOCKET"; 51 52 55 public static final String HEADER_PROTOCOL_10 = "HTTP/1.0"; 56 57 60 public static final String HEADER_PROTOCOL_11 = "HTTP/1.1"; 61 62 65 public static final String HEADER_PROTOCOL_V10 = "1.0".intern(); 66 67 70 public static final String HEADER_PROTOCOL_V11 = "1.1".intern(); 71 72 75 public static final String HEADER_POST = "POST"; 76 77 80 public static final String HEADER_GET = "GET"; 81 82 85 public static final String HEADER_HOST = "Host"; 86 87 90 public static final String HEADER_CONTENT_DESCRIPTION = 91 "Content-Description"; 92 93 96 public static final String HEADER_CONTENT_TYPE = "Content-Type"; 97 98 101 public static final String HEADER_CONTENT_TRANSFER_ENCODING = 102 "Content-Transfer-Encoding"; 103 104 107 public static final String HEADER_CONTENT_TYPE_JMS = "ContentType"; 108 109 112 public static final String HEADER_CONTENT_LENGTH = "Content-Length"; 113 114 117 public static final String HEADER_CONTENT_LOCATION = "Content-Location"; 118 119 122 public static final String HEADER_CONTENT_ID = "Content-Id"; 123 124 127 public static final String HEADER_SOAP_ACTION = "SOAPAction"; 128 129 132 public static final String HEADER_AUTHORIZATION = "Authorization"; 133 134 137 public static final String HEADER_PROXY_AUTHORIZATION = 138 "Proxy-Authorization"; 139 140 143 public static final String HEADER_EXPECT = "Expect"; 144 145 148 public static final String HEADER_EXPECT_100_Continue = "100-continue"; 149 150 153 public static final String HEADER_USER_AGENT = "User-Agent"; 154 155 158 public static final String HEADER_CACHE_CONTROL = "Cache-Control"; 159 160 163 public static final String HEADER_CACHE_CONTROL_NOCACHE = "no-cache"; 164 165 168 public static final String HEADER_PRAGMA = "Pragma"; 169 170 173 public static final String HEADER_LOCATION = "Location"; 174 175 178 public static final String REQUEST_HEADERS = "HTTP-Request-Headers"; 179 180 183 public static final String RESPONSE_HEADERS = "HTTP-Response-Headers"; 184 185 186 187 190 public static final String HEADER_TRANSFER_ENCODING = 191 "Transfer-Encoding".intern(); 192 193 196 public static final String HEADER_TRANSFER_ENCODING_CHUNKED = 197 "chunked".intern(); 198 199 202 public static final String HEADER_CONNECTION = "Connection"; 203 204 207 public static final String HEADER_CONNECTION_CLOSE = "close".intern(); 208 209 212 public static final String HEADER_CONNECTION_KEEPALIVE = 213 "Keep-Alive".intern(); 215 218 public static final String HEADER_ACCEPT = "Accept"; 219 220 223 public static final String HEADER_ACCEPT_TEXT_ALL = "text/*"; 224 225 228 public static final String HEADER_ACCEPT_APPL_SOAP = "application/soap+xml"; 229 230 233 public static final String HEADER_ACCEPT_MULTIPART_RELATED = 234 "multipart/related"; 235 236 239 public static final String HEADER_ACCEPT_APPLICATION_DIME = 240 "application/dime"; 241 242 245 public static final String HEADER_COOKIE = "Cookie"; 246 247 250 public static final String HEADER_COOKIE2 = "Cookie2"; 251 252 255 public static final String HEADER_SET_COOKIE = "Set-Cookie"; 256 257 260 public static final String HEADER_SET_COOKIE2 = "Set-Cookie2"; 261 262 265 public static String MC_HTTP_STATUS_CODE = "transport.http.statusCode"; 266 267 270 public static String MC_HTTP_STATUS_MESSAGE = 271 "transport.http.statusMessage"; 272 273 276 public static String MC_HTTP_SERVLET = "transport.http.servlet"; 277 278 281 public static String MC_HTTP_SERVLETREQUEST = 282 "transport.http.servletRequest"; 283 284 287 public static String MC_HTTP_SERVLETRESPONSE = 288 "transport.http.servletResponse"; 289 290 293 public static String MC_HTTP_SERVLETLOCATION = 294 "transport.http.servletLocation"; 295 296 299 public static String MC_HTTP_SERVLETPATHINFO = 300 "transport.http.servletPathInfo"; 301 302 305 public static final String HEADER_DEFAULT_CHAR_ENCODING = "iso-8859-1"; 306 307 310 public static final String PLUGIN_NAME = "transport.http.plugin.pluginName"; 311 312 315 public static final String PLUGIN_SERVICE_NAME = 316 "transport.http.plugin.serviceName"; 317 318 321 public static final String PLUGIN_IS_DEVELOPMENT = 322 "transport.http.plugin.isDevelopment"; 323 324 327 public static final String PLUGIN_ENABLE_LIST = 328 "transport.http.plugin.enableList"; 329 330 333 public static final String PLUGIN_ENGINE = "transport.http.plugin.engine"; 334 335 338 public static final String PLUGIN_WRITER = "transport.http.plugin.writer"; 339 340 343 public static final String PLUGIN_LOG = "transport.http.plugin.log"; 344 345 348 public static final String PLUGIN_EXCEPTION_LOG = 349 "transport.http.plugin.exceptionLog"; 350 351 354 public static final char OK[] = ("200 OK").toCharArray(); 355 356 359 public static final byte NOCONTENT[] = ("202 OK\n\n").getBytes(); 360 361 364 public static final byte UNAUTH[] = ("401 Unauthorized").getBytes(); 365 366 369 public static final byte SENDER[] = "400".getBytes(); 370 371 374 public static final byte ISE[] = ("500 Internal server error").getBytes(); 375 376 378 381 public static char HTTP[] = "HTTP/1.0 ".toCharArray(); 382 383 386 public static final String HTTP_REQ_TYPE = "HTTP_REQ_TYPE"; 387 388 public static final String HTTPOutTransportInfo = "HTTPOutTransportInfo"; 389 public static final String MTOM_RECIVED_CONTENT_TYPE = "MTOM_RECEIVED"; 390 391 394 public static final String HTTP_ELEMENT_CHARSET = "US-ASCII"; 395 396 401 public static byte[] getBytes(final String data) { 402 if (data == null) { 403 throw new IllegalArgumentException ("Parameter may not be null"); 404 } 405 406 try { 407 return data.getBytes(HTTP_ELEMENT_CHARSET); 408 } catch (UnsupportedEncodingException e){ 409 410 } 411 return data.getBytes(); 412 } 413 414 415 } 416 | Popular Tags |