public class DefaultHttpRpcResourceHandler extends AbstractHttpRpcResourceHandler
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ACCEPT_ENCODING |
protected static int |
BUFFER_SIZE |
protected static String |
CHARSET |
static String |
CONTENT_ENCODING |
static String |
CONTENT_TYPE |
protected static DateFormat |
DATE_FORMAT |
static String |
DEFAULT_CHARSET |
static boolean |
DEFAULT_DIR_ALLOWED |
static boolean |
DEFAULT_GZIP_ENABLE |
static String |
DEFAULT_GZIP_FILE_EXT |
static int |
DEFAULT_GZIP_MIN_SIZE |
static String |
DEFAULT_HOME_PAGE |
static String |
DEFAULT_ROOT |
protected static boolean |
DIR_ALLOWED |
static String |
ENCODING_GZIP |
static String |
ETAG |
protected static boolean |
GZIP_ENABLE |
protected static String |
GZIP_FILE_EXT |
protected static int |
GZIP_MIN_SIZE |
protected static String |
HOME_PAGE |
static String |
HTML_ERROR |
static String |
IF_MODIFIED_SINCE |
static String |
IF_NONE_MATCH |
static String |
LAST_MODIFIED |
static String |
MSG_304 |
static String |
MSG_403 |
static String |
MSG_404 |
protected static String |
ROOT |
| 构造器和说明 |
|---|
DefaultHttpRpcResourceHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected byte[] |
gzip(File file) |
void |
handle(com.sun.net.httpserver.HttpExchange exchange)
资源处理
|
protected void |
responseDirectory(com.sun.net.httpserver.HttpExchange exchange,
File directory,
OutputStream os) |
protected void |
responseError(com.sun.net.httpserver.HttpExchange exchange,
int code,
OutputStream os) |
protected void |
responseFile(com.sun.net.httpserver.HttpExchange exchange,
File file,
OutputStream os) |
protected void |
responseGzip(com.sun.net.httpserver.HttpExchange exchange,
File file,
OutputStream os) |
protected void |
responseHtml(com.sun.net.httpserver.HttpExchange exchange,
int code,
String html,
OutputStream os) |
protected void |
responseOk(com.sun.net.httpserver.HttpExchange exchange,
String html,
OutputStream os) |
protected void |
responseStream(com.sun.net.httpserver.HttpExchange exchange,
File file,
OutputStream os) |
public static final boolean DEFAULT_DIR_ALLOWED
public static final boolean DEFAULT_GZIP_ENABLE
public static final int DEFAULT_GZIP_MIN_SIZE
protected static final int BUFFER_SIZE
protected static final String ROOT
protected static final String CHARSET
protected static final String HOME_PAGE
protected static final boolean DIR_ALLOWED
protected static final boolean GZIP_ENABLE
protected static final int GZIP_MIN_SIZE
protected static final String GZIP_FILE_EXT
protected static final DateFormat DATE_FORMAT
public void handle(com.sun.net.httpserver.HttpExchange exchange)
throws IOException
IHttpRpcResourceHandlerexchange - HttpExchangeIOException - IOExceptionprotected void responseDirectory(com.sun.net.httpserver.HttpExchange exchange,
File directory,
OutputStream os)
throws IOException
IOExceptionprotected void responseOk(com.sun.net.httpserver.HttpExchange exchange,
String html,
OutputStream os)
throws IOException
IOExceptionprotected void responseError(com.sun.net.httpserver.HttpExchange exchange,
int code,
OutputStream os)
throws IOException
IOExceptionprotected void responseHtml(com.sun.net.httpserver.HttpExchange exchange,
int code,
String html,
OutputStream os)
throws IOException
IOExceptionprotected void responseFile(com.sun.net.httpserver.HttpExchange exchange,
File file,
OutputStream os)
throws IOException
IOExceptionprotected void responseStream(com.sun.net.httpserver.HttpExchange exchange,
File file,
OutputStream os)
throws IOException
IOExceptionprotected void responseGzip(com.sun.net.httpserver.HttpExchange exchange,
File file,
OutputStream os)
throws IOException
IOExceptionprotected byte[] gzip(File file) throws IOException
IOExceptionCopyright © 2020. All Rights Reserved.