public class HttpExchangeWrapper
extends com.sun.net.httpserver.HttpExchange
HttpExchange
包装类,提供增强方法和缓存Constructor and Description |
---|
HttpExchangeWrapper(com.sun.net.httpserver.HttpExchange raw)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Object |
getAttribute(String name) |
com.sun.net.httpserver.HttpContext |
getHttpContext() |
InetSocketAddress |
getLocalAddress() |
com.sun.net.httpserver.HttpPrincipal |
getPrincipal() |
String |
getProtocol() |
com.sun.net.httpserver.HttpExchange |
getRaw()
获取原始对象
|
InetSocketAddress |
getRemoteAddress() |
HttpServerRequest |
getRequest()
获取请求
|
InputStream |
getRequestBody() |
com.sun.net.httpserver.Headers |
getRequestHeaders() |
String |
getRequestMethod() |
URI |
getRequestURI() |
HttpServerResponse |
getResponse()
获取响应
|
OutputStream |
getResponseBody() |
int |
getResponseCode() |
com.sun.net.httpserver.Headers |
getResponseHeaders() |
void |
sendResponseHeaders(int rCode,
long responseLength) |
void |
setAttribute(String name,
Object value) |
void |
setStreams(InputStream i,
OutputStream o) |
public HttpExchangeWrapper(com.sun.net.httpserver.HttpExchange raw)
raw
- HttpExchange
public com.sun.net.httpserver.HttpExchange getRaw()
public HttpServerRequest getRequest()
public HttpServerResponse getResponse()
public com.sun.net.httpserver.Headers getRequestHeaders()
getRequestHeaders
in class com.sun.net.httpserver.HttpExchange
public com.sun.net.httpserver.Headers getResponseHeaders()
getResponseHeaders
in class com.sun.net.httpserver.HttpExchange
public URI getRequestURI()
getRequestURI
in class com.sun.net.httpserver.HttpExchange
public String getRequestMethod()
getRequestMethod
in class com.sun.net.httpserver.HttpExchange
public com.sun.net.httpserver.HttpContext getHttpContext()
getHttpContext
in class com.sun.net.httpserver.HttpExchange
public void close()
close
in class com.sun.net.httpserver.HttpExchange
public InputStream getRequestBody()
getRequestBody
in class com.sun.net.httpserver.HttpExchange
public OutputStream getResponseBody()
getResponseBody
in class com.sun.net.httpserver.HttpExchange
public void sendResponseHeaders(int rCode, long responseLength) throws IOException
sendResponseHeaders
in class com.sun.net.httpserver.HttpExchange
IOException
public InetSocketAddress getRemoteAddress()
getRemoteAddress
in class com.sun.net.httpserver.HttpExchange
public int getResponseCode()
getResponseCode
in class com.sun.net.httpserver.HttpExchange
public InetSocketAddress getLocalAddress()
getLocalAddress
in class com.sun.net.httpserver.HttpExchange
public String getProtocol()
getProtocol
in class com.sun.net.httpserver.HttpExchange
public Object getAttribute(String name)
getAttribute
in class com.sun.net.httpserver.HttpExchange
public void setAttribute(String name, Object value)
setAttribute
in class com.sun.net.httpserver.HttpExchange
public void setStreams(InputStream i, OutputStream o)
setStreams
in class com.sun.net.httpserver.HttpExchange
public com.sun.net.httpserver.HttpPrincipal getPrincipal()
getPrincipal
in class com.sun.net.httpserver.HttpExchange
Copyright © 2024. All rights reserved.