Class NioHttpUtil
java.lang.Object
org.summerboot.jexpress.nio.server.NioHttpUtil
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic byte[]decodeMimeBase64(String contentBase64) static voiddecodeMimeBase64(String contentBase64, File dest) static StringencodeMimeBase64(byte[] contentBytes) static StringencodeMimeBase64(File file) static StringgetFileContentType(File file) static StringgetHttpPostBodyString(io.netty.handler.codec.http.FullHttpRequest fullHttpRequest) static StringsanitizeDocRootUri(String uri, String docroot) Deprecated.static booleansanitizePath(String path) static booleansanitizeUri(String uri) static voidsendError(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpResponseStatus status, int errorCode, String msg, Throwable ex) static longsendFile(io.netty.channel.ChannelHandlerContext ctx, boolean isKeepAlive, ServiceContext serviceContext) static voidsendListing(io.netty.channel.ChannelHandlerContext ctx, File dir) Deprecated.static voidsendRedirect(io.netty.channel.ChannelHandlerContext ctx, String newUri, io.netty.handler.codec.http.HttpResponseStatus status) static longsendResponse(io.netty.channel.ChannelHandlerContext ctx, boolean isKeepAlive, ServiceContext serviceContext, ErrorAuditor errorAuditor) static longsendText(io.netty.channel.ChannelHandlerContext ctx, boolean isKeepAlive, io.netty.handler.codec.http.HttpHeaders serviceHeaders, io.netty.handler.codec.http.HttpResponseStatus status, String content, String contentType, String charsetName, boolean flush, ResponseEncoder responseEncoder) static voidsendWebResource(String httpRequestPath, ServiceContext response) static voidsendWebResource(ServiceRequest request, ServiceContext response)
-
Field Details
-
HTTP_HEADER_AUTH_TOKEN
- See Also:
-
HTTP_HEADER_AUTH_TYPE
- See Also:
-
HeaderName_ServerTimestamp
-
HeaderName_Reference
-
KEEP_ALIVE
public static final io.netty.util.AsciiString KEEP_ALIVE -
CONNECTION
public static final io.netty.util.AsciiString CONNECTION -
WebResourceCache
-
-
Constructor Details
-
NioHttpUtil
public NioHttpUtil()
-
-
Method Details
-
encodeMimeBase64
- Throws:
IOException
-
encodeMimeBase64
-
decodeMimeBase64
-
decodeMimeBase64
- Throws:
IOException
-
sendError
-
sendRedirect
public static void sendRedirect(io.netty.channel.ChannelHandlerContext ctx, String newUri, io.netty.handler.codec.http.HttpResponseStatus status) -
sendResponse
public static long sendResponse(io.netty.channel.ChannelHandlerContext ctx, boolean isKeepAlive, ServiceContext serviceContext, ErrorAuditor errorAuditor) -
sendText
public static long sendText(io.netty.channel.ChannelHandlerContext ctx, boolean isKeepAlive, io.netty.handler.codec.http.HttpHeaders serviceHeaders, io.netty.handler.codec.http.HttpResponseStatus status, String content, String contentType, String charsetName, boolean flush, ResponseEncoder responseEncoder) -
sendFile
public static long sendFile(io.netty.channel.ChannelHandlerContext ctx, boolean isKeepAlive, ServiceContext serviceContext) -
sendWebResource
-
sendWebResource
-
getFileContentType
-
getHttpPostBodyString
public static String getHttpPostBodyString(io.netty.handler.codec.http.FullHttpRequest fullHttpRequest) -
decode
-
sanitizeUri
-
sanitizePath
-
sanitizeDocRootUri
Deprecated. -
sendListing
Deprecated.
-